// if you are using onclick attribute you can write like this for example <button type="button" onclick="myFunction('testParameter')"> Test Button</button> <script> function myFunction(myString){ console.log(myString) } </script>