How to make a password box does not respond to the register?

There is a input field (input). When introduced to the word, immediately there is a redirect to the desired page. Here is an example code that I found online:

<script type="text/javascript">
 $('input').on('keyup paste', function(ev) {
 if(/PASSWORD/.test(this.value)) {
 location.href = '/main';

From the code it is seen that in the field, you have to enter the word "PASSWORD". The problem is that the field is case sensitive. For him, "Password", "password" and "PASSWORD" is different words. I would like to write the Password and that all worked. It is possible to rewrite the script or better to make a similar function in PHP? Alas, I am a designer, programming is difficult for me, I use only what I find in the network.
March 20th 20 at 11:49
1 answer
March 20th 20 at 11:51
if(/PASSWORD/i.test(this.value)) {

Find more questions by tags JavaScript