hpDragonNames.js (1889B)
1 var nm1 = ["Algerian", "American", "Angolan", "Antarctic", "Argentinian", "Armenian", "Australian", "Austrian", "Bolivian", "Brazilian", "British", "Bulgarian", "Cambodian", "Canadian", "Chilean", "Chinese", "Croatian", "Cuban", "Danish", "Egyptian", "Finnish", "French", "German", "Hungarian", "Indian", "Irish", "Italian", "Jamaican", "Japanese", "Mexican", "Mongolian", "Moroccan", "Nepalese", "Norwegian", "Peruvian", "Romanian", "Russian", "Slovenian", "South-African", "Spanish", "Swedish", "Thai", "Turkish", "Ukrainian", "Vietnamese"]; 2 var nm2 = ["Barb", "Blaze", "Bristle", "Dart", "Demon", "Ember", "Fire", "Flame", "Foul", "Fury", "Giant", "Glow", "Horn", "Iron", "Jade", "Long", "Mammoth", "Monster", "Opal", "Plate", "Rage", "Ridge", "Ruby", "Short", "Smooth", "Snake", "Soft", "Spark", "Spike", "Steel", "Storm", "Swift", "Thin", "Thorn", "Thunder", "Venom", "Vile", "Viper", "Warp", "Wide"]; 3 var nm3 = ["back", "belly", "bottom", "claw", "crown", "dart", "eye", "fang", "frame", "gut", "head", "horn", "muzzle", "paw", "rump", "scale", "skull", "snout", "spike", "stub", "tail", "tooth", "trunk", "tusk", "wing"]; 4 5 function nameGen(type) { 6 var tp = type; 7 var br = ""; 8 var element = document.createElement("div"); 9 element.setAttribute("id", "result"); 10 for (i = 0; i < 10; i++) { 11 rnd = Math.floor(Math.random() * nm1.length); 12 rnd2 = Math.floor(Math.random() * nm2.length); 13 rnd3 = Math.floor(Math.random() * nm3.length); 14 names = nm1[rnd] + " " + nm2[rnd2] + nm3[rnd3]; 15 br = document.createElement('br'); 16 element.appendChild(document.createTextNode(names)); 17 element.appendChild(br); 18 } 19 if (document.getElementById("result")) { 20 document.getElementById("placeholder").removeChild(document.getElementById("result")); 21 } 22 document.getElementById("placeholder").appendChild(element); 23 }