answersLogoWhite

0

document.getElementById() is a JavaScript method that returns a reference to a DOM object identified by the value passed to it. For instance, if you can a form with the following HTML code....

<form method="post" id="theForm">

You would be able to reference the form by assigning a variable to the returned value of document.getElementById(). Such as:

var myForm = document.getElementById("theForm");

You could them use the other DOM methods to manipulate this object (adding CSS styles, adding and removing children, etc.)

User Avatar

Wiki User

12y ago

What else can I help you with?