Javascript - document.getElementById() methodThe document.getElementById() method returns the element of specified id.
In the previous page, we have used document.form1.name.value to get the value of the input value. Instead of this, we can use document.getElementById() method to get value of the input text. But we need to define id for the input field. Let's see the simple example of document.getElementById() method that prints cube of the given number. Output of the above example
Next TopicDocument getElementsByName() Method
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week