Skip to main content

click

Description

fires when a button is clicked

Parameters

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