我需要在 chrome 中使用 Password 类型显示清除 X 按钮 我在努力
input[type="password"] {
-webkit-appearance: searchfield;
}
input[type="password"]::-webkit-search-cancel-button {
-webkit-appearance: searchfield-cancel-button;
}
<input type="password" placeholder="enter text here..." />
最佳答案
如果你想要原生/纯 CSS。这应该只适用于 Chrome。
.password {
-webkit-text-security: disc;
}
<input type="search" class="password" placeholder="enter text here..." />
关于javascript - 如何在输入密码的情况下在 chrome 中显示清除 X 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50654253/