Javascript – how to get the text of the hyperlink using javascript

javascript

i am having a hyperlink control and a button control like this:

Collapse | Copy Code

How can i get the text of the hyperlink using javascript:

Best Solution

Do you mean:


var hyperlinkText = document.getElementById('yourAnchorId').innerHTML;