How to insert a single correct answer in the input tag?

-1

I want the input tag to have a single correct answer. When entering a response (here we'll call it "example2"), go to a certain page (here, we'll use " link ").

    
asked by anonymous 21.10.2017 / 04:36

1 answer

0

If your goal is to open a particular Web page according to the user's response. This would be a possible solution:

function change(value){
switch(value){
case 'exemplo2':
   window.open('https://www.google.com.br');
}
}
<input type='text' placeholder='Digite:' onchange='change(value)'/>

If you test in a web browser, you will see that responding to 'example2' a new web page with the Google address will open.

    
24.10.2017 / 14:24