I have seen some similar posts of "Block words in text area using JS or jQuery"
Examples: Case 1: If list of words are: feel, appointment, only, attend, laser, submit
Case 2. Once a user hit the submit button a message should appear saying: "invalid codes" if any of those words are not in the list
If your goal is to check if a given string has certain words, you can use a regular expression such as:
const regex3 = /^(?=.*\bfeel\b)(?=.*\bappointment\b)(?=.*\bonly\b)(?=.*\battend\b)(?=.*\blaser\b)(?=.*\bonly\b).*$/ig
console.log(regex3.test(yourInputText)) //returns true if the string has the words in it
if you wanna add more words, just create more statements, example:
(?=.*\bYOUR_NEW_WORD\b)