I am trying to create an application that enters data from a user using a text box. Separate the string into spaces and find the bad words in the string. If a bad word is found, the results are displayed in the DOM.
I was looking for a form and could not find it. I found some PHP, but that does not help me. I believe that I have the correct pseudocode. Some recommendations will be helpful.
HTML below:
<body>
<input type="text" id="wordInput"/>
<button id="badWordCatch" onclick="badWordCatch;">Catch Bad Words</button>
<div id="wordsFound"></div>
<div id="wordAmount"></div>
</body>
Javascript below:
1. What words are put it
2. if the words are bad or not
*/
function badWordCatch(){
var wordInput = document.getElementById("wordInput").value;
var arr = wordInput.split(" ");
var badWords = ["legos", "cloud", "manifold"];
}
source
share