I am trying to get the text available inside the <a> elements. I have used the innerHTML to retrieve that inner text, but in few <a> elements the inner Text is placed inside the <span> elements.
While retrieving the text value am getting it as <span>sample text</span> as the output string. Can anyone help me to remove the <span></span> in the output string using RegEx so that i can only have sample text in my output string.
<a href="#"><span>Sample Text</span></a>
Note: I am not using any Javascript Libraries in the page.