DOM events in JS

1. DOM manipulation HTML
1.HTML DOM
When the web page is loaded, the browser will create the document object model of the web page
2.DOM manipulation HTML:
1) Change all HTML elements
in the page 2) Change all HTML attributes in the page page
3 ) Change all CSS styles
in the page 4) React to all events in the page
Note : Never use documient.write() after the document has loaded. This will cover the document
3. Find element:
   find HTML element by id Find HTML element
   by tag name
4. Change HTML content:
  use attribute: innerHTML
5. Change HTML attribute:
  use attribute: attribute
Second, DOM manipulation CSS
syntax:
document.getElementByld(id).style.property=new style

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326746985&siteId=291194637