[3 / 1 / ?]
Quoted By:
I'm writing a userscript in greasemonkey and I came across a problem. First of all the html in question is like this:
<select id="status">
<option selected="selected" value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
I'm trying to simulate a click on Option 2. I tried doing document.getElementById('status').children[1].click() but it doesn't work and I don't think you can use click() on an option tag. Anyone know how to click an option tag in javascript?
<select id="status">
<option selected="selected" value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
I'm trying to simulate a click on Option 2. I tried doing document.getElementById('status').children[1].click() but it doesn't work and I don't think you can use click() on an option tag. Anyone know how to click an option tag in javascript?