Search On Google

Saturday, December 29, 2018

What Is HTML DOM

HTML DOM (Document Object Model):-
When web page load in the browser at that time browser create DOM of the page.
This object is good for accessing webpage's elements and performing some event on them.
Suppose we want to search some element then we have much more option given via DOM.

Here in below if element found then element will be return as object so we can perform some task on that element.

1.Searching element object by id:-
Example: -
var elem1 = document.getElementById("myid");

2.Searching element object by class Name:-
Example: -
var var1 = document.getElementsByClassName("myclass");

3.Searching element object by tag Name:-
Example: -
var tag1 = document.getElementsByTagName("p");





No comments:

Post a Comment

About Me

My photo
Mumbai, Maharashtra, India