Html —— 密码输入框输入后显示为星号

it2024-03-28  51

问题

在输入密码时,为了防止被其他人看到,要将其显示成“*”,如何实现?

解决

将input的类型设置为password即可。

<div class="a-b"><input class="a-b-c" type="password" placeholder="请输入密码"></div>

效果

最新回复(0)