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
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
http://jayandsilentrob.com/2006/07/31/web-20-tricks-with-prototype-creating-a-drop-down-list/