I use the Javascript bookmarklet to automatically fill out the form on the page. Some of the options given are drop-down options that show different options depending on what is selected using onchange (). I have code similar to this:
var dropDown1 = document.getElementById("dropDown1Name"); dropDown1.value = "option1InDropDown"; dropDown1.onchange(); var dropDown2 = document.getElementById("dropDown2Name"); dropDown2.value = "optionRevealedByDropDown1Change";
However, this does not work, because onchange () does not populate the second from the bottom by the time I set it to a value. By the time the script completes, dropDown2 has no value. I tried several methods so that the code "waited", but I could not find the right solution. Any suggestions are welcome.
source share