Loading


Advertisement:

Author Topic: [SOLVED] Show / hide password using Javascript  (Read 511 times)

calinbehtuk

  • Sr. Member
  • ****
  • Posts: 260
Re: [SOLVED] Show / hide password using Javascript
« Reply #30 on: September 14, 2017, 02:35:00 pm »
what is your site address, or what theme you use?

goodisme

  • Newbie
  • *
  • Posts: 18
Re: [SOLVED] Show / hide password using Javascript
« Reply #31 on: September 14, 2017, 02:52:38 pm »
www.xxxxxx.com
 
select login on footer and compare with header dropdown
« Last Edit: September 14, 2017, 06:16:04 pm by goodisme »

calinbehtuk

  • Sr. Member
  • ****
  • Posts: 260
Re: [SOLVED] Show / hide password using Javascript
« Reply #32 on: September 14, 2017, 04:59:50 pm »
I don't know if it the best solution but you can try like this.
Code: [Select]
                <script type="text/javascript">
                    $(document).ready(function () {
                        $('.form-signin #password').addClass('password_content');
                        $(document).on("mousedown", "#show", function () {
                            var x = document.getElementsByClassName("password_content");
                            x[0].type = "text";
                            var obj = document.getElementById('password');
                            obj.type = "text";
                        });
                        $(document).on("mouseup", "#show", function () {
                            var x = document.getElementsByClassName("password_content");
                            x[0].type = "password";
                            var obj = document.getElementById('password');
                            obj.type = "password";
                        });
                    });
                </script>

goodisme

  • Newbie
  • *
  • Posts: 18
Re: [SOLVED] Show / hide password using Javascript
« Reply #33 on: September 14, 2017, 06:09:34 pm »
It worked!! Thanks  :)