Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Random names</title>
- <meta name="description" content="A do it yourself name generator from online-generators.com" />
- <!-- The Generator script. You can move the script to an external file for better overview -->
- <script type="text/javascript">
- /* Online Name Generators v.1.0 script is made by Niels Gamborg webmaster at online-generator.com.
- * The script is free (as in "free speech" and also as in "free beer") in anyway. Use it after you own likings.
- * Peace and love. :)
- */
- function generator(){
- // Add your own words to the wordlist. Be carefull to obey the showed syntax
- var wordlist1 = ["It's the heir :)", "It's not the heir :(", "Next one is heir :|"]
- // Random numbers are made
- var randomNumber1 = parseInt(Math.random() * wordlist1.length);
- var name1 = wordlist1[randomNumber1];
- //alert(name); //Remove first to slashes to alert the name
- //If there's already a name it is removed
- if(document.getElementById("result")){
- document.getElementById("placeholder").removeChild(document.getElementById("result"));
- }
- // A div element is created to show the generated name. The Name is added as a textnode. Textnode is added to the placeholder.
- var element = document.createElement("div");
- element.setAttribute("id", "result");
- element.appendChild(document.createTextNode(name1));
- document.getElementById("placeholder").appendChild(element);
- }
- </script>
- </head>
- <body onload="generator()">
- <div id="wrapper">
- <!-- Change the text to your needs -->
- <p>If the heir is already chosen, ignore this</p>
- <!-- The generator result and button. Change text on the button by changing button value. Be carefull changing ID's in this part -->
- <div id="generator" >
- <div id="placeholder"></div>
- </div>
- <!-- Change the text to your needs -->
- <p></p>
- <!-- The footer. Place any contact info ect here.-->
- </p>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement