show hide password with eye icon in php code example

Example 1: html show password

//Javascript show all password textboxes script by me
var k = document.getElementsByTagName('input')
for(i=0;i<k.length;i++){
    if(k[i].type = "password"){
        k[i].type = "text"
    }
}

Example 2: css styles responsive password input eye

.login-form{margin:20px 0 0 0;}
.login-form input[type=text]{
  background: #fff;
  border: none;
  border-radius:8px;
  position: relative;
  font-size:15px !important;
  display: inline-block;
  outline: none;
  width: 100%;
  height: 30px !important;
  padding: 18px 0 18px 20px;
  margin-bottom:15px !important;
  color: #666 !important;
  border: 1px solid grey;
}

.login-left{width:44%; margin: 0 0 0 5%; display:inline-block; float:left;}
.login-right{width:44%; margin: 0 5% 0 0; display:inline-block; float:right;}

@media screen and (max-width:767px) {
.login-width{width:95% !important;}
.login-left{width:90%; margin: 0 auto; display:block; float:none;}
.login-right{width:90%; margin: 0 auto; display:block; float:none;}
}

.p-viewer, .p-viewer2{
  float: right;
  margin-top: -55px;
  position: relative;
  z-index: 1;
  cursor:pointer;
}

.fa-eye {
  color: #000;
}