JavaScript > HTML DOM

DOM Methods in JavaScript

What is the use of DOM Methods in javascript

DOM Methods

DOM Methods are defined as actions when we perform on html elements, DOM properties are values of html element that we can change or set the values.

All HTML elements as defined as objects, programming interface is an property and method of an object.


Property is a value that we can set or get, for example changing content of HTML element


Method is an action performed while adding or deleting an element.

    <p id="demo"></p>
        document.getElementById("demo").innerHTML = "TechFunda!";

In the above code getElementById is a method and innerHTML is a property, GetElementById uses id to find element and innerHTML is used to change the value of element.

 Views: 253 | Post Order: 204

Write for us