Skip to content
Advertisement

Javascript: how can I redirect to a url or another url after checking if user input specific words?

I’m tryng to achieve if user input on id “comments” is word that is present in my FilterWord’s array then user will be redirected to an url. If input is anything else, then user will be redirected to another url.

Checking has to start after user click on submit.

JavaScript
JavaScript

Advertisement

Answer

Just validate with some.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement