<div> <button onclick="YourFunction()" value="CallMyFunction"></button> </div> <script> function YourFunction() { console.log("Hello Word") } </script>