I'm trying to change the options in a dropdown menu via a script - however nothing seems to happen. No errors either.
Here is the script:
javascript:
var objDropDownMenuName = document.getElementsByName("jjoprs")[0];
function writeText(form) {
$(objDropDownMenuName.options[1]).selected = true;
$(objDropDownMenuName).change();
}
writeText(this.form);
Here is the html of the form:
<select name='jjoprs' class='select2'>
<option value='NULL' selected> </option>
<option value='1060'>Sofi, Laco</option>
<option value='5160'>Vandrlka, Edo</option>
</select>
Thanks!
Edit: I am executing this script in IE8
document.getElementById('idHere'), its much more efficient to select things by ID