I have the following select tag:
<select id="myselect">
<option value="1">Mr</option>
<option value="2">Mrs</option>
<option value="3">Ms</option>
<option value="4">Dr</option>
<option value="5">Prof</option>
</select>
How can I console.log the value of option tag number 2? I am trying this, but it isn't working.
$(document).ready(function () {
console.log($("#myselect option")[2].val());
});