JoshWegener
asked on
Replace a dropdown with prototype.
Lets say we have a dropdown, I want to remove all the current options, and place new ones in the dorpdown.
for example, the drop down says a, b, c ... I wnat to change them to 1, 2, 3 .. how do I got about this using prototype?
for example, the drop down says a, b, c ... I wnat to change them to 1, 2, 3 .. how do I got about this using prototype?
ASKER
if I do $('spanID').innerHTML = '<select><option>bla</opti on><select >' it works... but I need to leave the select alone... if I do, $('selectID').innerHTML = '<option>bla</option>' it does not work... any idea?
save the attached code as test.html and try it:
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://jayandsilentrob.com/2006/07/31/web-20-tricks-with-prototype-creating-a-drop-down-list/