Discuss / JavaScript / 利用了正则表达式

利用了正则表达式

Topic source

      Array.from(document.querySelector('#test-list').children).forEach(e => {

        if (/^Swift$|^ANSI\sC$|^DirectX$/.test(e.innerText)) {

          e.parentElement.removeChild(e)

        }

      })


  • 1

Reply