Random Text Tutorial

Tutorial

  1. Add the following code to your website.
    <script type="text/javascript">
    <!--
    var randomtext = new Array();
    var i = 0;

    randomtext[i++] = 'RANDOM TEXT';

    var num = Math.floor(Math.random() * randomtext.length);
    document.write(randomtext[num]);
    -->
    </script>
  2. Replace RANDOM TEXT with your text. If your text includes an apostrophe, you need to put a backslash in front of it (like this: \').
  3. To add more random text, add this after the first line of random text.
    randomtext[i++] = 'RANDOM TEXT'

Random Text Example