How can I create a text box that redirects to certain pages depending on the content?

izmichael profile image IzMichael ・1 min read

I'm trying to make an input box that redirects me based on the content.

For example, if Input is 1111 it redirects to the Home Page, but if the input is 1112, it redirects to the contact page.

Thanks for any and all help.


Editor guide
kevinschweikert profile image
Kevin Schweikert
if (variable == 1111) {
window.location = url
else if  (variable == 1112) {
window.location = other_url