Use document.all(elementId) to get the element : all : Document JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Document » all »

 

Use document.all(elementId) to get the element

















<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
function findhead1()
{
    var detectElement;
    detectElement = document.all("head1");
    if (detectElement == head1)
    {
        alert("Element 'head1' exists");
    }
}

//  -->
</script>
</head>
<body onload="findhead1()">
<h1 id="head1">Heading One</h1>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Document
» all