<!DOCTYPE html> <html> <head> <script> function myFunction() { alert("text here!"); } </script> </head> <body> <button onclick="myFunction()">do it</button> </body> </html>