answersLogoWhite

0


Best Answer

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

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

The instruction document.getElementById is used in JavaScript, followed by a unique ID. It identifies and returns the HTML element that has the specified ID.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is document.getElementById in javascript?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why you use documentgetElementByIddemo in java script?

DocumentgetElementByID is used to refer a attribute by it's id. This will get the element with the id defined anywhere in the page.


What is a javascript tutorial?

A JavaScript tutorial contains instructions that will teach you how to code in JavaScript.


What are built-in javascript classes?

Javascript does not have classes


How do you sort in javascript?

Javascript can help in browseing


How old is Javascript?

Javascript was created in 1995.


What is the Javascript onclick?

Onclick will be called when the object you're attaching the onclick function to is clicked (usually the object is an HTML element).


What languages can a browser understand?

HTML, CSS, &amp; JavaScript.


Do you need java compiler to execute HTML programs written in javascript?

No, Java and JavaScript are nothing to do with each other, JavaScript is a form of EMCAScript, not Java. Every modern browser comes with a JavaScript engine that is used to understand JavaScript. so there is no need for it, no.


Is JavaScript or Dreamweaver better?

Not comparable. JavaScript is a programming language. Dreamweaver is an application (which you can use to create pages with javascript, html, etc.)


What are the best tutorials on javascript?

http://www.w3schools.com under the Javascript Section.


How do you use javascript in aspnet?

Ajax, I believe uses JavaScript + ASP.


What do you call java and javascript?

Well you get java as java and javascript as iava.