Created
January 10, 2012 16:38
-
-
Save johnkpaul/1589927 to your computer and use it in GitHub Desktop.
Add elements to bizodo select boxes programatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options_to_add = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"20+"]; | |
var event = document.createEvent("MouseEvents"); | |
event.initMouseEvent("click", true, true, window, | |
0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
for(var i=0,len=options_to_add.length;i<len;i++){ | |
$$(".option_add")[0].dispatchEvent(event) | |
var empty_element = $$(".option_editor_row").filter(function(el){return el.firstChild.value == ""})[0]; | |
empty_element.firstChild.value = options_to_add[i]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment