Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Define a Function in JavaScript</title> </head> <body> <script> function myFunction(){ alert("You have successfully defined the function!"); } </script> <button type="button" onclick="myFunction();">Click Me</button> </body> </html>