What is HTML DOM?

0 votes
22 views
Ravi Vishwakarma asked 13 days ago in Web Application by Ravi Vishwakarma

What is HTML DOM?

1 Answer

0 votes
Ethan Karla answered 11 days ago by Ethan Karla
When a web page is loaded, the browser creates a Document object model of the page.
• JavaScript can change all the HTML elements in the page
• JavaScript can change all the HTML attributes in the page
• JavaScript can change all the CSS styles in the page
• JavaScript can remove existing HTML elements and attributes
• JavaScript can add new HTML elements and attributes
• JavaScript can react to all existing HTML events in the page
• JavaScript can create new HTML events in the page
The HTML DOM is a standard object model and programming interface for HTML in DOM.
• The HTML elements as objects
• The properties of all HTML elements
• The methods to access all HTML elements
• The events for all HTML elements
The HTML DOM is a standard for how to get, change, add, or delete HTML elements.
Finding HTML elements
document.getElemntById(id)
document.getElemntsByClassName(class-name)
document.getElemntsByTagName(tagname)
Changing HTML element
element.innerHTML
element.attribute
element.style.property
 Adding events handler
document.getElementById(id).event-name= function-name(){
Function body
}