This javascript quote generator is used to view the messages randomly. This java script helps you to generate random quote or random message.
Features
a) You can randomly view the message using this random quote generator.
b) Javascript quote generator can also be used as random number generator if we give numbers instead of text in array.
c) You can generate random quotes using this random quote generator.
d) Just copy the code and use it.
< !-- 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>
For customization of this script or any script development, contact us at support@hscripts.com
Usage
a) Copy the codes given in the textarea and use it.
b) Here (Math.random()*3) is used in order to get the message from the array of zero'th position to fourth position.
c) CSS code is used to design the page with some styles as background-color, font-color etc.
d) 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 the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.