JavaScript: Setting the disabled Flag
I'm trying to set the disabled flag on a input element. If you know of an easier way, please. Othwise, what is wrong with this?
Code:
<html>
<head>
<title>Test Page</title>
<script type="text/javascript">
function foo() {
alert(document.getElementByID("myInput").nodeName);
}
</script>
</head>
<body>
<form name="myForm">
<input id="myInput" type="text" size="8" value="2">
</form>
<p onclick="javascript:foo();">Click Me</p>
</body>
</html>
I can't get it to return nodeName, much less can I try to setAttributeNode, which may not even be what I need to do.