Skip to content
Advertisement

Tag: findelement

selecting element based on innertext javascript

I am trying to search this DOM. My search criteria is innerText, which is “div-1”. If that innerText is found, then I want to return the value as “div-1-span-1-div” and “div-1-span-1-span” which are again the innerText. How to achieve this using Javascript. Answer While I’m unsure of the logic behind the requirements I believe the following code seems to do

Advertisement