【发布时间】:2018-01-14 14:00:47
【问题描述】:
我有一个表格,它在 mysql 中存储了许多密码
我们需要隐藏密码,并在需要时点击所需密码
但问题是,通过点击切换,会显示第一个密码
例如:(这不是主要来源)
<!DOCTYPE html>
<html>
<body>
<p>Click the radio button to toggle between password visibility:</p>
Password: <input type="password" value="FakePSW" id="myInput">
<input type="checkbox" onclick="myFunction()">Show Password
<br>
Password: <input type="password" value="FakePSW" id="myInput">
<input type="checkbox" onclick="myFunction()">Show Password
<script>
function myFunction() {
var x = document.getElementById("myInput");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>
</body>
</html>
我使用了id="'.$row["id"].'",但这还不够
【问题讨论】: