Created
June 3, 2026 04:39
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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