Discuss / JavaScript / filter比removeChild更简单

filter比removeChild更简单

Topic source

舒军

#1 Created at ... [Delete] [Delete and Lock User]

Array.from(document.getElementsByTagName("li")).filter(p => ['JavaScript', 'HTML', 'CSS'].includes(p))

舒军

#2 Created at ... [Delete] [Delete and Lock User]

直接filter不行😓,还是removeChild吧,


  • 1

Reply