Skip to content

Instantly share code, notes, and snippets.

@eallenOP
Created June 3, 2026 04:39
Show Gist options
  • Select an option

  • Save eallenOP/80601f0c3d4dd92e5156a8066f011220 to your computer and use it in GitHub Desktop.

Select an option

Save eallenOP/80601f0c3d4dd92e5156a8066f011220 to your computer and use it in GitHub Desktop.
How to pass a parameter to a function called in an event listener (Svelte)
<script>
function handleClick(userData){
// Do something with the data
}
</script>
<button onclick={() => {handleClick(data)}}>Click me</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment