<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
< html lang ="ru" >
< head >
< title > </ title >
< script type ="text/javascript" src ="script.js" ></ script >
</ head >
< body >
< div >
< form action ="index.html" >
< p >
< input type ="text" value ="" class ="authFormInput authFormInputLogin" id ="authFormInputLogin" name ="authFormInputLogin" />
< input type ="text" value ="" class ="authFormInput authFormInputPass" id ="authFormInputPass" name ="authFormInputPass" />
< input type ="submit" value =" " />
</ p >
</ form >
</ div >
</ body >
</ html >
* This source code was highlighted with Source Code Highlighter .
window.onload = function () {
window. document .getElementById( 'authFormInputPass' ).onfocus = function () {
this .setAttribute( "type" , "password" );
}
}
* This source code was highlighted with Source Code Highlighter .
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
< html lang ="ru" >
< head >
< title > </ title >
< script type ="text/javascript" src ="script.js" ></ script >
< style type ="text/css" >
.hidden {
display: none;
}
.visible {
display: block;
}
</ style >
</ head >
< body >
< div >
< form action ="index.html" >
< p >
< input type ="text" value ="" class ="authFormInput authFormInputLogin" id ="authFormInputLogin" name ="authFormInputLogin" />
< input type ="text" value ="" class ="authFormInput authFormInputPass visible" id ="authFormInputPassT" name ="authFormInputPassT" />
< input type ="password" value ="" class ="authFormInput authFormInputPass hidden" id ="authFormInputPass" name ="authFormInputPass" />
< input type ="submit" value =" " />
</ p >
</ form >
</ div >
</ body >
</ html >
* This source code was highlighted with Source Code Highlighter .
window.onload = function () {
var authFormInputPass = document .getElementById( 'authFormInputPass' );
var authFormInputPassT = document .getElementById( 'authFormInputPassT' );
authFormInputPassT.onfocus = function () {
authFormInputPassT.className= "authFormInput authFormInputPass hidden" ;
authFormInputPass.className= "authFormInput authFormInputPass visible" ;
authFormInputPass.focus();
}
authFormInputPass.onblur = function () {
if (!authFormInputPass.value) {
authFormInputPass.className= "authFormInput authFormInputPass hidden" ;
authFormInputPassT.className= "authFormInput authFormInputPass visible" ;
}
}
}
* This source code was highlighted with Source Code Highlighter .
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
< html lang ="ru" >
< head >
< title > </ title >
< script type ="text/javascript" src ="script.js" ></ script >
< style type ="text/css" >
.noPass {
background-image:url('pass.gif');
}
</ style >
</ head >
< body >
< div >
< form action ="index.html" >
< p >
< input type ="text" value ="" class ="authFormInput authFormInputLogin" id ="authFormInputLogin" name ="authFormInputLogin" />
< input type ="password" value ="" class ="authFormInput authFormInputPass noPass" id ="authFormInputPass" name ="authFormInputPass" />
< input type ="submit" value =" " />
</ p >
</ form >
</ div >
</ body >
</ html >
* This source code was highlighted with Source Code Highlighter .
window.onload = function () {
var authFormInputPass = document .getElementById( 'authFormInputPass' );
authFormInputPass.onfocus = function () {
authFormInputPass.className= "authFormInput authFormInputPass" ;
}
authFormInputPass.onblur = function () {
if (!authFormInputPass.value) {
authFormInputPass.className= "authFormInput authFormInputPass noPass" ;
}
}
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/65410/
All Articles