WEBPAPI Dynamically Create Nodes and Application

html:

+

+

 

Small class summary:

1. Three methods of dynamically creating elements

1. Method 1: document.write (not recommended, use very little)

2. Method 2: innerHTML (for small cases)

3. Method 3: document.createElement (commonly used)

Two, document.createElement method related

1, document.createElement (create a new child element)

2. rolls.appendChild(ul) add child elements to the node

3. removeChild This is a method to delete child elements

Guess you like

Origin blog.csdn.net/qq_42113778/article/details/103922547