Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

selected select html jquery

<select id="menu">
   <option value="1">Opción 1</option>
   <option value="2">Opción 2</option>
   <option value="3">Opción 3</option>
</select>
<script >
  $(function () {
     $("#menu option[value='2']").attr("selected", true);
  });
</script>
 
PREVIOUS NEXT
Tagged: #selected #select #html #jquery
ADD COMMENT
Topic
Name
4+6 =