The onclick attribute can call functions from an included script when a visitor clicks on the button.

Set onclick to "sayHello()".

<html>
<body>
  <button onclick="sayHello()">Click me!</button>
  <p id="prompt"></p>
<script>function sayHello() {
console.log("Website published!");
}</script>
</body>
</html>]]>

Make sure to add the function call sayHello().