How to Put a Popup Message on Your Website

If you're a frequent Web browser, you've likely encountered a page with a popup alert box. Depending on your mood, you may have found this box annoying or you may have wondered how to implement it on your own page. If you're in the latter camp, you can learn how to create a JavaScript popup message box that visitors see when they visit your Web page. This task can be completed quickly.

Instructions

    • 1

      Open the HTML file for your Web page in Notepad, the text application bundled with Windows.

    • 2

      Copy and paste the following code into your HTML file between the <body> and </body> tags:

      <script> function MYALERT() {

      alert("Insert your message here"); } MYALERT()

      </script>

    • 3

      Replace the "Insert your message here" text between the quotation marks with the message you want visitors to see when they get to your page.

    • 4

      Click "File," then click "Save" to save your changes. When you publish your updated page to the Web and visit in your Web browser, you'll be greeted with a popup message box containing the text you added.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured