Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get element by click

window.onclick = e => {
    console.log(e.target);  // to get the element
    console.log(e.target.tagName);  // to get the element tag name alone
} 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #element #click
ADD COMMENT
Topic
Name
1+5 =