- document.createElement (); you need to pass in a tag name as a parameter. You will create a corresponding node according to the tag name and return the node. document.createTextNode (); you need to pass in a text content as the parameter appendChild ()
Usage: parent element.appendChild( child node ).
A child of a node can be inserted before the new node
Usage: Parent node. insertBefore( new node, old node );
Replacechild(); replace child node
Usage: parent.replaceChild( new node, old node );
Removechild(); can delete a child node
Usage: parent.removeChild(child node).
InnerHTML can also be used to add dom. Generally, the two methods are combined.
e.g. city.innerHTML += " <li>GuangZhou</li> ";
Confirm (“); a prompt box with confirm and Cancel buttons will pop up. If the user clicks confirm, it will return true; otherwise, it will return false </ OL>
- JS bug Log Uncaught TypeError: Cannot read property ‘previoustSibling‘ of null
- Difference between innerHTML and innerText
- Application of call, apply and bind methods
- Vue refreshes the current page (no flash screen will appear)
- Android realizes the fade in and fade out of animation effect
- Asynchronous loading method of Baidu map
- Vant Applet: The Usage of Vant-dialog in Before-close
- How to use Runtime.getRuntime().Exec()
- Method of adding operation button for each line of data in DataGrid of easyUI
- How to Block a frame with origin from accessing a cross origin frame
- Localstorage sets the expiration time.
- package.json Scripts configuration environment variable distinguishes development environment from production environment
- [Solution] VUE.js Load a local image with parameters in the script
- How to Test whether the property value of each property in the object is not empty
- CSS to achieve dynamic display of picture text by mouse touch
- JS uses onerror to automatically catch exceptions
- H5 page left and right stretch content area
- If the request parameter is formdata, use the Ajax operation
- JS to determine whether the string contains a character
- Vue-cli2 sub environment packaging