2

Imagine I have this:

<li><a href="{{ route('admin') }}">Admin Panel</a></li>

Is there a way to remove this and make it so that if a user types "admin" to be sent to that page using JavaScript + jQuery?

I've seen web sites that execute some code if you type a certain phrase so I've been wondering if I could implement something similar.

Onyx
  • 5,186
  • 8
  • 39
  • 86

1 Answers1

0

Try this one:

    function gotoPage(input){
      if (input.value == "admin") {
        window.open('http://www.google.com');
      }
    }
<input type="text" name="" value="" onkeyup="gotoPage(this)">
Erlisar Vasquez
  • 460
  • 3
  • 13