How to get text from HTML anchor tag <a href="#">Text</a> with JavaScript

1 Answer

0 votes
<a href="#" id="a-id" onclick="show_text()">English</a>
function show_text() {
    alert(document.getElementById("a-id").textContent);
}

 



answered Nov 28, 2018 by avibootz
...