click
Description
fires when a button is clickedParameters
- ev - (object) a CustomEvent object
Example
<script>
function handleClick(ev){
console.log("A button has been clicked");
}
</script>
<Button on:click={handleClick}>Click me</Button>
Related article: Catching a button click