Last active
July 30, 2018 03:47
-
-
Save rrameshbtech/e1aad25e5ac3cc1acba09389e7036d7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<button id="thisButton" onclick="verifyThis(this)">Check this</button> | |
<script> | |
const thisButton = document.getElementById('thisButton'); | |
function verifyThis(buttonWhichTriggered) { | |
console.log(buttonWhichTriggered === thisButton); // true | |
console.log(this === window); // true | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment