waddleteam
New Member
I can't seem for the life of me to ever get this to work.By my eyes, everything seems fine, I don't see what's wrong. I am trying to re-write the value of closed to testing. It is noted that the select box is populate dynamically.\[code\]<html><head><script type="text/javascript">window.onload = function() { loadit() }function loadit(){var x = new Array() x[0] = "" x[1] = "ACTIVE" x[2] = "ON HOLD" x[3] = "CLOSED" for (i=0; i<x.length; i++) { document.getElementById('d1').options=new Option(x, i) }}function changeit() {var el = document.getElementById("d1");for(var i=0; i < el.options.length; i++){ if(el.options.value =http://stackoverflow.com/questions/12748761/="CLOSED"){ el.options.value = "http://stackoverflow.com/questions/12748761/TESTING"; el.options.innerText = "TESTING"; } }}</script></head><body><select name="d1" id="d1" style="width: 200px;"></select><p><a href="javascript:changeit()">change</a></p></body></html>\[/code\]