I accidentally tried the below code
How does sample
in the below script gets logged without selecting the element using a selector or assigning it to a variable
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
console.log(sample);
});
</script>
</head>
<body>
<p id="sample">If you click on me, I will disappear.</p>
<p class="sample">If you click on me, I will disappear.</p>
</body>
</html>