Home>Article>Web Front-end> How to delete html in javascript
Javascript method to delete html: 1. Delete nodes through removeChild; 2. Delete the option at the specified index through remove; 3. Delete rows and cells in the table through deleteRow and deleteCell.
The operating environment of this article: windows7 system, javascript1.8.5&&html5 version, DELL G3 computer
JavaScript delete HTML element
被控制的目标元素
RESULT
1
2
Result
删除第行, 第列
1 | 2 |
3 | 4 |
5 | 6 |
Result
Recommended study: "javascript Advanced Tutorial》
The above is the detailed content of How to delete html in javascript. For more information, please follow other related articles on the PHP Chinese website!