Isaac
asked on
onchange not working
Anybody know why the onchange() isn't working? This is the error I get
Uncaught ReferenceError: getProj is not defined
at HTMLSelectElement.onchange
http://jsfiddle.net/isogunro/r6e4gm34/
Uncaught ReferenceError: getProj is not defined
at HTMLSelectElement.onchange
http://jsfiddle.net/isogunro/r6e4gm34/
<select id="contracts" onchange="getProj(this)">
<option value=""></option>
</select>
<span id="ctType"></span>
function getProj(sel) {
var ct = document.getElementById("ctType");
ct.innerHTML = contractAry[2].contractType;
alert(sel.value);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How did you get it to work in your fiddle though? It's exactly like mines but yours works and mines doesn't.
if you put that one in <script>...<script> tags, it will work
your code is wrapped with
Open in new window
jsFiddle adds this if you select onLoad