<html>
<head>
</head>
<body>
<script>
function x() {
console.log (thisWorks)
}
</script>
<button onclick="x()"></button>
</body>
</html>
my hopes were that clicking the button would trigger the console command and i could add more code, but when i click it i get an error that looks like this error message
im using opera GX browser about:blank page.
I checked w3schools and copied directly from their page, where it worked, i still got the error. (https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onclick)
i tried moving the functions before the button element, i tried putting the script in the parent element of the button, i tried copying from the html in the w3schools page and it’s the same error.
honestly im a very novice coder and it’s probably something stupid but i would appreciate some help
bestbuilder04 bob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.