Home>Article>Web Front-end> How to remove li in javascript
Javascript method to remove li: First create an HTML sample file; then create the li tag content; finally pass "op[i].onclick = function () {oList[i].remove().. .}" method can delete one line of content of the li tag.
The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer
How to remove li from javascript?
Native Js implementation to delete a line of content in the li tag
##Use object-oriented Idea completes the buyer information deletion function. Each piece of information includes:
Name (name)Gender (sex)
Phone number (number)
Province (province)
Achieve the following requirements:
You cannot borrow any third-party libraries and need to use native code to implement them.Combined with the basic code structure given, add the code in the two code here below to complete the deletion function of buyer information. Note that this page must be clearly displayed on the mobile phone.
The js code can be adjusted arbitrarily, for example, it can be completed using es6 code.
Completed code:
demo
序号
姓名
性别
电话号码
省份
操作
1
张三
男
13788888888
浙江
删除
2
李四
女
13788887777
四川
删除
3
王二
男
13788889999
广东
删除
javascript Advanced Tutorial"
The above is the detailed content of How to remove li in javascript. For more information, please follow other related articles on the PHP Chinese website!