OZONE Asylum
Forums
DHTML/Javascript
Moving an <option> to the bloody top in IE
This page's ID:
30735
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
This answer is a little late, but try doing something like this: [code] <select id="foo"> <option value="0">A</option> <option value="1">B</option> <option value="2">C</option> <option value="3">D</option> <option value="4">E</option> <option value="5">F</option> </select> <script type="text/javascript"> function moveOptionToTop( indx ){ var sel = document.getElementById("foo"); var cpy = sel.options[indx].cloneNode(true); sel.options[indx] = null; sel.insertBefore(cpy, sel.options[0]); } moveOptionToTop( 5 ); </script>[/code] Eric
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »