Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="password" name="password" size="30" />
- <input type="password" name="password" id="myPassword" size="30" />
- <img src="theicon" onmouseover="mouseoverPass();" onmouseout="mouseoutPass();" />
- function mouseoverPass(obj) {
- var obj = document.getElementById('myPassword');
- obj.type = "text";
- }
- function mouseoutPass(obj) {
- var obj = document.getElementById('myPassword');
- obj.type = "password";
- }
- <input name="password" class="password" type="password" />
- <div class="icon">icon</div>
- $('.icon').hover(function () {
- $('.password').attr('type', 'text');
- }, function () {
- $('.password').attr('type', 'password');
- });
- <input type="password"
- onmousedown="this.type='text'"
- onmouseup="this.type='password'"
- onmousemove="this.type='password'">
- <div class="container">
- <div class="row">
- <div class="col-md-8 col-md-offset-2">
- <div class="panel panel-default">
- <div class="panel-body">
- <form class="form-horizontal" method="" action="">
- <div class="form-group">
- <label class="col-md-4 control-label">Email</label>
- <div class="col-md-6">
- <input type="email" class="form-control" name="email" value="">
- </div>
- </div>
- <div class="form-group">
- <label class="col-md-4 control-label">Password</label>
- <div class="col-md-6">
- <input id="password-field" type="password" class="form-control" name="password" value="secret">
- <span toggle="#password-field" class="fa fa-lg fa-eye field-icon toggle-password"></span>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- .field-icon {
- float: right;
- margin-right: 8px;
- margin-top: -23px;
- position: relative;
- z-index: 2;
- cursor:pointer;
- }
- .container{
- padding-top:50px;
- margin: auto;
- }
- $(".toggle-password").click(function() {
- $(this).toggleClass("fa-eye fa-eye-slash");
- var input = $($(this).attr("toggle"));
- if (input.attr("type") == "password") {
- input.attr("type", "text");
- } else {
- input.attr("type", "password");
- }
- });
- <form>
- <label for="username">Username:</label>
- <input id="username" name="username" type="text" placeholder="Username" />
- <label for="password">Password:</label>
- <input id="password" name="password" type="password" placeholder="Password" />
- <input id="submit" name="submit" type="submit" value="Login" />
- </form>
- <script>
- function seetext(x){
- x.type = "text";
- }
- function seeasterisk(x){
- x.type = "password";
- }
- </script>
- <body>
- <img onmouseover="seetext(a)" onmouseout="seeasterisk(a)" border="0" src="smiley.gif" alt="Smiley" width="32" height="32">
- <input id = "a" type = "password"/>
- </body>
- <input type="password" name="password">
- // show on focus
- $('input[type="password"]').on('focusin', function(){
- $(this).attr('type', 'text');
- });
- // hide on focus Out
- $('input[type="password"]').on('focusout', function(){
- $(this).attr('type', 'password');
- });
- <html>
- <head>
- </head>
- <body>
- <script>
- function demo(){
- var d=document.getElementById('s1');
- var e=document.getElementById('show_f').value;
- var f=document.getElementById('show_f').type;
- if(d.value=="show"){
- var f= document.getElementById('show_f').type="text";
- var g=document.getElementById('show_f').value=e;
- d.value="Hide";
- } else{
- var f= document.getElementById('show_f').type="password";
- var g=document.getElementById('show_f').value=e;
- d.value="show";
- }
- }
- </script>
- <form method='post'>
- Password: <input type='password' name='pass_f' maxlength='30' id='show_f'><input type="button" onclick="demo()" id="s1" value="show" style="height:25px; margin-left:5px;margin-top:3px;"><br><br>
- <input type='submit' name='sub' value='Submit Now'>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment