11. HTML DOM : JAVASCRIPT

HTML DOM 

(Document Object Model)

HTML DOM

It is a standard article model and programming interface for HTML. It characterizes: 

  • The HTML components as articles 
  • The properties of all HTML components 
  • The techniques to get to all HTML components 
  • The occasions for all HTML components 
  • The most widely recognized approach to get to an HTML component is to utilize the id of the component. 


As such: The HTML DOM is a norm for how to get, change, add, or erase HTML components 


GetElementById - It is utilized to focus on the HTML through its id. 


For DOM to work, remember that while choosing the components with its id, there ought to be a special id for each component in the HTML code. You can't work with two same ids for various components else it will make an issue. 


InnerHTML Property - It is the most sincere approach to get the substance of a component. It helps get or remove the substance of HTML components. 


GetElementsByClassName - we can likewise deliver the components from HTML with the assistance of class name. Assuming we need to track down every one of the components with a similar class name, use it. 


QuerySelector - It is utilized to discover all HTML components that match a predefined CSS selector (id, class names, types, attributes, values of attributes, etc).


QuerySelectorAll - It is utilized to focus on the components.

Post a Comment

0 Comments