After having some issues with this myself (and realizing I just had a syntax error), this is what I've found to work: This definetely helped me.
In script, Create a function sayhello () like below function sayHello() { console.log("Hello World") } Here is an example button-click.svelte . In the method change the radio button content with the help of setText method. Data-Target with the button: first we create < p > tag a, etc some of the ToggleButton changes enter a name for your project type=! var wpcf7 = {"apiSettings":{"root":"https:\/\/filmsdivision.org\/wp-json\/contact-form-7\/v1","namespace":"contact-form-7\/v1"}}; The JavaScript onclick functions can be triggered by object.onclick or object.addEventListener. /*