eHow launches Android app: Get the best of eHow on the go.

How To

How to Add Javascript Using HTML Programming

Contributor
By Angela Wells
eHow Contributing Writer
(3 Ratings)

You can add JavaScript to your web pages to make them more interactive and entertaining. JavaScript is a scripting language used to add elements like functionality or validating forms to a site. JavaScript can be used to create drop-down menus, alert messages and more. There are many places on the internet that offer free JavaScripts; or, if you know JavaScript scripting language, you can create your own.

Difficulty: Easy
Instructions
  1. Step 1

    Start the word processor or text editor you will use to create your web page. Locate the web page you will be editing. Position the cursor where you want the JavaScript to appear on your page.

  2. Step 2

    Type <SCRIPT TYPE=“text/javascript”> on your page.

  3. Step 3

    Type the code for the JavaScript you will be using.

  4. Step 4

    Type </SCRIPT> to complete the JavaScript. Your text should be similar to the following example, which shows JavaScript added to display a pop-up message:<SCRIPT TYPE=“text/javascript”>Alert(“All visitors to our site can enter to win our fast cash drawing with no obligation!”);</SCRIPT>

  5. Step 5

    Open a new web browser to verify that your web page is running the JavaScript correctly. Test the JavaScript to verify that it is user-friendly.

Tips & Warnings
  • Display your web page in several browsers to see how each one renders it.
  • You can store your JavaScript codes in separate files so your web page will not be cluttered, or to enable you to use JavaScript on several web pages.
Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Tags
Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

eHow Computers
eHow_eHow Technology and Electronics