Answers for "selected select html jquery"

2

jquery selected option

$( "#myselect option:selected" ).val();
Posted by: Guest on July-13-2020
3

option selected jquery

$('select option[value=8272]').attr('selected', '');
Posted by: Guest on July-02-2021
0

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>
Posted by: Guest on October-07-2021

Browse Popular Code Answers by Language