Answers for "get the text of a tag"

0

get the text of a tag

var el = document.querySelector('div');
text = el.textContent || el.innerText;
console.log(text);
Posted by: Guest on March-02-2022

Code answers related to "get the text of a tag"

Code answers related to "Javascript"

Browse Popular Code Answers by Language