When I want to set a value to the textfield i do this:
document.getElementById("some-textfield").value = "BlahBlahBlah";
But how to choose an option from dropdown option list:
<select tabindex = "11" name="b_month">
<option value="">---</option>
<option value="1">Jan</option>
<option value="2">Feb</option>
<option value="3">Mar</option>
I was trying something like this:
document.getElementByName("b_month").options[2]
But it doesn’t work.
Again I want to change it in the website, so when i type it in console, I would see the result.
Thank you
getElementByNameis not a function. You need to usegetElementsByName(note the plurality), then select the appropriate element from the returned collection: