Published
- 1 min read
selected select html jquery
The solution for this is noted below
selected select html jquery
Solution
<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>
Try other methods by searching on the site. That is if this doesn’t work