<html>
<body>
<p>Click the button to check whether the variable y is defined or undefined.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
if (typeof y === "undefined") {
��� txt = "y is undefined";
} else {
��� txt = "y is defined";
}
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>