0

I'm trying to select all the divs in the following example whose innerHTML are equal to "Practice".

<div data="t"><p>Practice</p></div>
<div><p>Practice</p></div>
<div data="t"><span>Practice</span></div>

I know xpath can do this job. I'd just like to know whether queryselectorall can also do this job?

PutBere
  • 131
  • 1
  • 12
  • 1
    As `querySelectorAll` takes a CSS selector, the answer is: no. – trincot Oct 17 '20 at 11:18
  • 1
    You should make another question asking "How can all elements with a certain text can be selected with Javascript?", I think that's what you want the answer for (that's what I would've responded if the question wasn't closed) – alotropico Oct 17 '20 at 11:20

0 Answers0