'namedItem()' Example : namedItem « Javascript Methods « JavaScript Reference

'namedItem()' Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    document.all.namedItem("myDiv1").innerText = "Named Item"; 
} 
</script>
<div id="myDiv1" style="width:600; height:200; background-color:blue;">
Click button to change me
</div>
<button onclick="function1();">Named item</button>
</body>
</html>

    
      
      








Related examples in the same category

1.'namedItem()' Syntax, Parameters and Note
2.'namedItem()' is applied to