Html tag with a unique id can be used as a variable named the id directly ?
code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="text" id="mytest">
</body>
<script>
console.log(mytest);
console.log(mytest === document.getElementById('mytest'));
console.log(Object.hasOwnProperty(window,'mytest'));
</script>
</html>
How could this be ? Where is mytest
?