How to Print a Message With Javascript

How to Print a Message With Javascript thumbnail
Communicate with your Web visitors with a JavaScript Message.

JavaScript is a Web scripting language used to provide client-side functionality such as form validation and user messages. There are many ways in which JavaScript can help you with the development of your website. You can use JavaScript to print a message to your Web page or via an alert window.

Instructions

  1. Web page message.

    • 1

      Create a new file and save it as "myPageTest.html."

    • 2

      Insert the following into the file:

      <html>

      <body>

      <script >

      document.write("A test JavaScript Message.");

      </script>

      </body>

      </html>

    • 3

      Save the file and test it by double-clicking on it. The message should appear on your Web page.

    Alert window.

    • 4

      Create a new file and save it as "myAlertTest.html."

    • 5

      Insert the following into the file:

      <html>

      <body>

      <script >

      alert("A test JavaScript Message.");

      </script>

      </body>

      </html>

    • 6

      Save the file and test it by double-clicking on it. The message will appear in an alert window.

Related Searches:

References

  • Photo Credit keyboard image by Fyerne from Fotolia.com

Comments

You May Also Like

Related Ads

Featured