When you select the show plaintext check box, you need to display the password entered by the user in plaintext. If you do not select this box, you need to change the ciphertext. The problem is that the type attribute abstract of the input cannot be modified in ie8:
Now, you need to check the show plaintext check box to display the password entered by the user in plaintext, the first thought was to modify the type of the input box to determine whether to display the plaintext or ciphertext, and use jQuery's attr for testing. The test results are chrome, Firefox, and ie9 +, an error will be reported under ie8. The following reason is found. In ie8, the type attribute of input cannot be modified, and another idea is implemented.
If the text box is selected, replace the input box with type = "text". If the text box is not selected, replace the text box with type = "password". The Code is as follows: