1. Home
  2. Computing & Technology
  3. JavaScript

Random Tip Maker

Join the Discussion

Questions? Comments?

Even if you have no knowledge of JavaScript coding whatsoever you can add a simple random tip script into your web page. Simply type the tips you want to display into the form below one at a time and then press the "Add Tip" button. The random tip script will appear in the textarea below and will include all of the tips you have entered so far. Just keep adding tips until all of the tips you need have been entered.

If you want to get fancier you can even include HTML codes within the tips.

Tip:

Once you have entered all of the tips you then just need to press the "Highlight All" button and copy and paste the code into a plain text editor such as notepad. Save the file as tip.js and upload the file to your site.

The final step is to attach the script into your web page in the body section of your page where you want the tips to appear using the following code:

<script type="text/javascript" src="tip.js">
</script>

Each time the page is displayed, one of the tips will be selected at random and displayed at that spot within the page.

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.