Skip to content

Instantly share code, notes, and snippets.

View nathan-a-macleod's full-sized avatar
📚
Studying

Nathan MacLeod nathan-a-macleod

📚
Studying
View GitHub Profile
@nathan-a-macleod
nathan-a-macleod / app.js
Created May 2, 2020 09:52
Return 'innerText' of the clicked element with JavaScript.
window.onclick = e => { // Change 'window' to anything - for example 'document.getElementById("myDIV")'
console.log(e.target.innerText);
}