Word Generator using JS Array — JMD Computing Club - Make Money | SEO Internet Hacks

Word Generator using JS Array


Source code



<form name="JournalForm">  
<h2><input type="text" name="JournalText"></h2>
<input type="button" value="Generate" onClick="GenerateWord(document.JournalForm);" id="button">
</form>

var Dictionary = 28

var words = new BuildArray(Dictionary)

// Use the following variables to
// define your random words:
words[1] = "internet"
words[2] = "internethacks"
words[3] = "internethacksjournal"
words[4] = "internet hack tips"
words[5] = "ethical hacking"
words[6] = "ethical hacking learning"
words[7] = "ethical hacking tips"
words[8] = "jii saaduddin iot"
words[9] = "cybersecurity"
words[10] = "cybersecurity awareness"
words[11] = "cybersecurity awareness example"
words[12] = "cyberattack"
words[13] = "learn ethical hacking"
words[14] = "cybersecurity vs ethical hacking"
words[15] = "whitehat vs blackhat vs greyhat"
words[16] = "attack concepts"
words[17] = "welcome to internet hacks journal"
words[18] = "hacking journal"
words[19] = "social engineering"
words[20] = "smartphone hacking"
words[21] = "information security"
words[22] = "programming"
words[23] = "learning code"
words[24] = "free sourcecode"
words[25] = "programming language"
words[26] = "internet of things"
words[27] = "network security"
words[28] = "application security"

function BuildArray(size){
this.length = size
for (var i = 1; i <= size; i++){
this[i] = null}
return this
}

function GenerateWord(frm) {
// Generate a random number between 1 and Number Of Words
var rnd = Math.ceil(Math.random() * Dictionary)

// Display the word inside the text box
frm.JournalText.value = words[rnd]
}


If you have any question or suggestion. Comment down below...

Please subscribe to my channel and follow my social links on the right side button.

Thank you! Don't forget to share this :)

Post a Comment

**PLEASE LEAVE YOUR COMMENT BELOW**