422,904 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,904 IT Pros & Developers. It's quick & easy.

Encapsulationg the jsquery in php button to show and hide the password

P: 1
Expand|Select|Wrap|Line Numbers
  1. <!doctype html> <head> <title>Show password </title> <script>
  2. //show password button
  3. $(document).ready(function(){
  4.     $("#showpassword").on('click', funtion(){
  5.         var pass = $('"password");
  6.         var fieldtype = pass.attr('type');
  7.         if(fieldtype == 'password'){
  8.             pass.attr('type','text');
  9.             $(this).text("Hide Password");
  10.  
  11.         }else{
  12.             pass.attr('type','password');
  13.             $(this).text("Show Password");
  14.         }
  15.     });
  16. });
  17.  
  18. </script> </head> <body> <form action = "https://bytes.com/" method = "post"> <input type = "password" placeholder = "Enter password" name = "password" id = "password"> <button type = "submit" value = "show password" name = "showpassword" id = "showpassword" >Show Password</button> </form> </body> </html>
This function is not working.i got this from online tutorial video.i tried it but it not working.
can anyone tell me the reason y isnt working.
tutorial Video link:
http://www.trainingwithliveproject.c...-tutorial.html.
Mar 30 '17 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
This function is not working.
the error console (F12) will tell you why.
Mar 31 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.