How do I refer to the span that is in the li?
-
There is an li tag with a class volga, inside it are spans (there are many of them, so there is no specific number), one of which contains the text "Volga". How can I use js or jquery to refer to exactly the span that lies in li.volga?JavaScript Anonymous, Jul 7, 2019
-
Anonymous -
const selector = "li.volga span"
const txt = "волга"
const elem = Array.from(document.querySelector(selector)).find(v => v.innerText.includes(txt))James Cantu
2 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!