IE can't access selectedIndex more then once?
Posted: Sat May 02, 2009 10:56 pm
For some reason when I run this script in IE it works the first time but always fails on the second execution (and all others until you reload the page). Any one have any suggestions for getting around this please?
JavaScript
HTML
JavaScript
Code: Select all
alert(document.getElementById('meta_example').options[document.getElementById('meta_example').selectedIndex].getAttribute('title'));Code: Select all
<select id="meta_example" name="meta_example">
<option title="fiction" value="5">Fiction</option>
<option title="forums" value="6">Forums</option>
<option title="gallery" value="7">Gallery</option>
<option title="gamer" value="8">Gamer</option>
<option title="home" value="9">Home</option>
<option title="music" value="10">Music</option>
<option title="blog" value="3">News & Blog</option>
<option title="philosophy" value="11">Philosophy</option>
<option title="translations" value="12">Translations</option>
<option title="web" value="13">Web</option>
</select>