“Show password as text” control

后端 未结 7 1062
花落未央
花落未央 2021-01-05 03:21

I have a usual login form consisting of two input fields, one for login, one for password. I am currently trying to add a control that will show entered password as plain te

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-05 03:50

    I have never tried this myself but can't you just access the value property of the element?

    if you have something like...

    
    

    Then in JavaScript / jQuery...

    var pass = document.getElementById('pw').value;
    
    $('pw').val()
    

提交回复
热议问题