JavaScript is a scripting computer programming language commonly used to create interactive effects within web browsers.
This sample file will display a "Hello World!" message when the button is clicked.
-
Create a new HTML file and name it hello-world.html.
-
Add the following HTML:
<!doctype html> <html> <head> <title>JavaScript Hello World!</title> </head> <body> <h1>JavaScript Hello World!</h1> <button onclick="alert('Hello World!');">Clck Me</button> </body> </html>
-
Save the file and test in a browser.
-
Try uploading this file to your hosting and then test it using your domain name. It will look something like this:
http://www.domain.com/folder/hello-world.html
Full tutorial URL:
https://codeadam.ca/learning/javascript-hello-world.html
- Visual Studio Code or Brackets (or any code editor)
- Filezilla (or any FTP program)
- W3Schools - JavaScript