W3Schools Tryit Editor

PHOTO EMBED

Sun Jan 29 2023 08:15:23 GMT+0000 (Coordinated Universal Time)

Saved by @ahmad_raza #undefined

<!DOCTYPE html>
<html>
<body>
​
<h1>The JavaScript <i>this</i> Keyword</h1>
​
<p>In this example, <b>this</b> refers to the window object:</p>
​
<p id="demo"></p>
​
<script>
let x = this;
document.getElementById("demo").innerHTML = x;
</script>
​
</body>
</html>
​
content_copyCOPY

https://www.w3schools.com/js/tryit.asp?filename