ok i need help again with my code

so this is my current setup:

HTML:

<button type="button" id="okbutton" onclick="go()">OK</button>

JS:

function go() {
// stuff
}

every time i’ve clicked the button, nothing happens and i get "go()" is not defined in the console

Nov 20, 2022, 1:52 AM
1 0 11

comments (single view)

Learn svelte or sveltekit

That's my #1 advice for web developers

never worked for me

in sveltekit your app would look like this:

<script>
function go() {
  //stuff
}
</script>
<button type="button" id="okbutton" on:click={go}>OK</button>
View all comments