[JAVASCRIPT]顯示input password 密碼

如標題

參考文章來源  stackoverflow討論串,作者 Tieson T.

https://stackoverflow.com/questions/42430601/trying-to-enable-show-hide-feature-in-asp-net/42430795

<label>Password fields are just a UI convience:</label>
<input type="password" id="password" value="super secret password" />
<label>
  <input type="checkbox" id="toggle-password" /> Toggle
</label>
$(function() {
  $('#toggle-password').on('change', function(e) {
    var _this = $(this);

    if (_this.is(':checked')) {
      $('#password').attr({
        'type': 'text'
      });
    } else {
      $('#password').attr({
        'type': 'password'
      });
    }
  })
});

 

以上文章僅用紀錄資料使用.....