我们使用d5fd7aea971a85678ba271703566ebfd标签,通过将password赋值给type属性,在html表单中接收密码输入。当我们输入密码时,它会立即隐藏字符。这也是一个单行文本输入。
语法<form> <input type=password name=name… value= >male</form>
示例 1一个在html中实现密码输入的示例如下:
<!doctype html><html><body><head> <meta charset=utf-8> <meta name=description content=meta tag in the web document> <meta name=keywords content=html,css> <meta name=author content=lokesh> <meta name=viewport content=width=device-width, initial-scale=1.0></head><p>branch</p><form> <input type=password id=cse name=branch value=cse > <label for=cse>enter password</label> <br> <input type=password name=branch value=it > <label for=cse>re-enter password</label></form></body></html>
示例 2下面给出了另一个将输入作为密码的示例。您可以尝试运行以下代码 -
<!doctype html><html><body><head> <title>html forms</title></head><p>add your details:</p><form> student username:<br> <input type=text name=name> <br> password:<br> <input type=password name=password> <br></form></body></html>
以上就是我们如何在html表单中输入密码?的详细内容。