Answers for "how to get the text of a clicked elemet by javascript"

1

how to get the text of a clicked elemet by javascript

document.addEventListener('click', function(e) {
    e = e || window.event;
    var target = e.target || e.srcElement,
        text = target.textContent || target.innerText;   
}, false);
Posted by: Guest on May-13-2020
-1

how to get the text of a clicked elemet by javascript

$(document).click(function(event) {
    var text = $(event.target).text();
});
Posted by: Guest on July-29-2020

Code answers related to "how to get the text of a clicked elemet by javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language