Random Quote Generator Script

  This javascript quote generator is used to view the messages randomly. This java script helps you to generate random quote or random message.

Features

  • You can randomly view the message using this random quote generator.
  • Javascript quote generator can also be used as random number generator if we give numbers instead of text in array.
  • You can generate random quotes using this random quote generator.
  • Just copy the code and use it.

Preview


Random Quote Generator
Click Next to Display Random message

Downloads

CSS Code
<style>
.row
{
padding-left:10px;background-color:white;
font-family: verdana, san-serif;font-size: 13px
</style>
 
Javascript Code


< !-- Script by hscripts.com -->
<script type="text/javascript">
var arr= new Array();
arr.push("Javascript is a client-side scripting language");
arr.push("Javascript is different from Java");
arr.push("CSS - Cascading Style Sheet");
arr.push("HTML is a platform independent language");
function rotate()
{
var num= Math.round(Math.random()*3);
add(num);
}
function add(i)
{
var chi = document.createTextNode(arr[i]);
var tab1 = document.getElementById("add1");
while(tab1.hasChildNodes())
{
tab1.removeChild(tab1.firstChild);
}
tab1.appendChild(chi);
}
</script>
< !-- Script by hscripts.com -->

HTML Code

<table align=center style="background-color:#C0C0C0";>
<tr>
<td background-color:#C0C0C0 align=center width=300 style="font-family:Times New Roman;">
<b>Random Quote Generator
</td>
</tr>
<tr>
<td id=add1 class=row width=300 align=center>Click Next to Display Random message</td>
</tr>
<tr><td align=center>
<input type=button value="Next" border=0 onclick="rotate()"></td></tr>
</table>
  • Release Date - 04-01-2008
  • Get free version without ©copyright link for just $5/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Copy the codes given in the textarea and use it.
  • Here (Math.random()*3) is used in order to get the message from the array of zero'th position to fourth position.
  • CSS code is used to design the page with some styles as background-color, font-color etc.
  • Array values are randomly generated using arr.push()method.

License

  • The javascript (misspelled as java script) is given under GPL License.
  • i.e. Free use for those who use it as it is.
  • Free, if your modification does not remove our copyright information and links.
  • Detailed License information can be found here.
  • You can purchase the script if your requirements does not meet GPL License terms.

Related Scripts

Free Javascript Scripts