I am trying to add a simple button using svelte as shown below. The button appears but is not clickable and appears to have no event listeners attached to it. I am having this problem with any event listener in the whole template project except the links since we explicitly specify the href link. Is there a step I am missing to get it to work?
example code in the "Home.svelte" file
<script>
function handleClick() {
alert('clicked')
}
</script>
<button on:click={handleClick}>Click me </button>
I am a newbie so your help would be so much appreciated, thank you :)
I am trying to add a simple button using svelte as shown below. The button appears but is not clickable and appears to have no event listeners attached to it. I am having this problem with any event listener in the whole template project except the links since we explicitly specify the href link. Is there a step I am missing to get it to work?
example code in the "Home.svelte" file
<button on:click={handleClick}>Click me </button>
I am a newbie so your help would be so much appreciated, thank you :)