The following code doesn't seem to execute properly for me, and I'm puzzled as to why. NonITView
and ITView
are both divs in my ASP page. txtIsIT
is an asp:textbox
on the page that gets either "yes" or "no" on page load.
if (document.getElementById("<%= txtIsIT.ClientID %>").value = "yes") {
$("#NonITView").hide("slow");
$("#ITView").show("slow");
}
else if (document.getElementById("<%= txtIsIT.ClientID %>").value = "no") {
$("#ITView").hide("slow");
$("#NonITView").show("slow");
}
else {
alert("Error");
}
The if
is evaluating properly. In firefox's web console, by entering the jquery .show/.hide functions, the divs are properly shown/hidden, which is part of what's confusing me. Anything sticking out to you that should be fixed?