Guest User

Untitled

a guest
Jan 16th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. <input type="password" name="password" size="30" />
  2.  
  3. <input type="password" name="password" id="myPassword" size="30" />
  4. <img src="theicon" onmouseover="mouseoverPass();" onmouseout="mouseoutPass();" />
  5.  
  6. function mouseoverPass(obj) {
  7. var obj = document.getElementById('myPassword');
  8. obj.type = "text";
  9. }
  10. function mouseoutPass(obj) {
  11. var obj = document.getElementById('myPassword');
  12. obj.type = "password";
  13. }
  14.  
  15. <input name="password" class="password" type="password" />
  16. <div class="icon">icon</div>
  17.  
  18. $('.icon').hover(function () {
  19. $('.password').attr('type', 'text');
  20. }, function () {
  21. $('.password').attr('type', 'password');
  22. });
  23.  
  24. <input type="password"
  25. onmousedown="this.type='text'"
  26. onmouseup="this.type='password'"
  27. onmousemove="this.type='password'">
  28.  
  29. <div class="container">
  30. <div class="row">
  31. <div class="col-md-8 col-md-offset-2">
  32. <div class="panel panel-default">
  33. <div class="panel-body">
  34. <form class="form-horizontal" method="" action="">
  35.  
  36. <div class="form-group">
  37. <label class="col-md-4 control-label">Email</label>
  38. <div class="col-md-6">
  39. <input type="email" class="form-control" name="email" value="">
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <label class="col-md-4 control-label">Password</label>
  44. <div class="col-md-6">
  45. <input id="password-field" type="password" class="form-control" name="password" value="secret">
  46. <span toggle="#password-field" class="fa fa-lg fa-eye field-icon toggle-password"></span>
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54.  
  55. .field-icon {
  56. float: right;
  57. margin-right: 8px;
  58. margin-top: -23px;
  59. position: relative;
  60. z-index: 2;
  61. cursor:pointer;
  62. }
  63.  
  64. .container{
  65. padding-top:50px;
  66. margin: auto;
  67. }
  68.  
  69. $(".toggle-password").click(function() {
  70. $(this).toggleClass("fa-eye fa-eye-slash");
  71. var input = $($(this).attr("toggle"));
  72. if (input.attr("type") == "password") {
  73. input.attr("type", "text");
  74. } else {
  75. input.attr("type", "password");
  76. }
  77. });
  78.  
  79. <form>
  80. <label for="username">Username:</label>
  81. <input id="username" name="username" type="text" placeholder="Username" />
  82. <label for="password">Password:</label>
  83. <input id="password" name="password" type="password" placeholder="Password" />
  84. <input id="submit" name="submit" type="submit" value="Login" />
  85. </form>
  86.  
  87. <script>
  88. function seetext(x){
  89. x.type = "text";
  90. }
  91. function seeasterisk(x){
  92. x.type = "password";
  93. }
  94. </script>
  95. <body>
  96. <img onmouseover="seetext(a)" onmouseout="seeasterisk(a)" border="0" src="smiley.gif" alt="Smiley" width="32" height="32">
  97. <input id = "a" type = "password"/>
  98. </body>
  99.  
  100. <input type="password" name="password">
  101.  
  102. // show on focus
  103. $('input[type="password"]').on('focusin', function(){
  104.  
  105. $(this).attr('type', 'text');
  106.  
  107. });
  108. // hide on focus Out
  109. $('input[type="password"]').on('focusout', function(){
  110.  
  111. $(this).attr('type', 'password');
  112.  
  113. });
  114.  
  115. <html>
  116. <head>
  117. </head>
  118. <body>
  119. <script>
  120. function demo(){
  121. var d=document.getElementById('s1');
  122. var e=document.getElementById('show_f').value;
  123. var f=document.getElementById('show_f').type;
  124.  
  125. if(d.value=="show"){
  126. var f= document.getElementById('show_f').type="text";
  127. var g=document.getElementById('show_f').value=e;
  128. d.value="Hide";
  129.  
  130. } else{
  131. var f= document.getElementById('show_f').type="password";
  132. var g=document.getElementById('show_f').value=e;
  133. d.value="show";
  134. }
  135. }
  136. </script>
  137.  
  138. <form method='post'>
  139. 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>
  140. <input type='submit' name='sub' value='Submit Now'>
  141.  
  142. </form>
  143. </body>
  144. </html>
Add Comment
Please, Sign In to add comment