I have a text box element whose value I am trying to access using document.getElementById(\"id-name\").value
. I find that the call is returning a null instead o
This demo is returning correctly for me in Chrome 14, FF3 and FF5 (with Firebug):
var mytextvalue = document.getElementById("mytext").value;
console.log(mytextvalue == ''); // true
console.log(mytextvalue == null); // false
and changing the console.log
to alert
, I still get the desired output in IE6.