html可编辑中的密码,尽管“ continedible = false”?

发布于 2025-02-12 14:06:24 字数 218 浏览 0 评论 0原文

我有一个具有给定值的简单输入字段,就像以下内容一样:

<input class="pw" contenteditable="false" type="password" value="1234"></input>

如您所见,我将“可满足”设置为“ false”,这意味着我不应该从浏览器中更改值。 但是,我可以更改它,我不知道为什么?

I have a simple input field with a given value just as the following:

<input class="pw" contenteditable="false" type="password" value="1234"></input>

As you can see, I set "contenteditable" to "false" meaning that I shouldn't be able to change the value from the Browser.
However, I can change it and I have no idea why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七颜 2025-02-19 14:06:24

亲爱的,如果您想在不可编辑的输入字段中显示密码,那么您只使用读取属性。

<input class="pw" type="password" value="1234" readonly="true"></input>

Dear if you want to show password in non-editable input field then you shoud use read only attribute.

<input class="pw" type="password" value="1234" readonly="true"></input>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文