I have a html code like
<div>
<span>TV</span>
</div>
I want to find this span
through documentObject having text 'TV', like getElementById
etc ... something like getElementByText
. I know that it's possible through XPath/JQuery/Regex.
But I need it to get through DOM object model only. As only DOM model is available in my context. I see couple of answers:
- Finding an html element ID based on a text displayed
- jquery - find element that only has text and not any other html tag
- how to find element after some text with javascript?
But these are not helpful to me, as I need to get it through DOM model only.