DEV Community

IzMichael
IzMichael

Posted on

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

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.

Top comments (1)

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