xxxxxxxxxx
<div>
<button onclick="YourFunction()" value="CallMyFunction"></button>
</div>
<script>
function YourFunction() {
console.log("Hello Word")
}
</script>
xxxxxxxxxx
<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Click me</button>
<script>
function myFunction() {
alert("Hello, World!");
}
</script>
</body>
</html>