How to present asterisk when entering a password i

2019-07-09 02:27发布

Using that code :

<!-- THIS IS WHERE IT ALL STARTS  -->


<!DOCTYPE html>
<html>
<head><title>Bank application</title>
<link rel="stylesheet"
      href="./css/styles.css"
      type="text/css"/>
</head>

<body>
<table class="title">
  <tr><th>Web Bank application</th></tr>
</table>

<br/>
<fieldset>
  <legend>Login Page - please enter your Username and Password</legend>
  <form action="loginPage"> 
    Username: <input type="text" name="username"><br>
    Password : <input type="text" name="password"><br>
    <input type="submit" value="Login">
  </form>
</fieldset>

<br/>
<br/>
<br/>
<br/>
<br/><br/><br/><br/><br/><br/>
</body></html>

The user enters his username and password enter image description here

How can I present to the screen asterisks (*) when I enter the password , e.g. instead of showning myPassword , I want to present ********** , and keep the actual characters of the string myPassword in tact ?

Thanks

3条回答
小情绪 Triste *
2楼-- · 2019-07-09 02:52

<input type="password" name="password">

查看更多
贼婆χ
3楼-- · 2019-07-09 02:56

change it to

<input type="PASSWORD" name="password">

Specifications

查看更多
等我变得足够好
4楼-- · 2019-07-09 03:19

When working with passwords, use the input type="password" instead of text. The format is the same, it will just tell the browser that you want your user to enter a password in it, or other sensitive data, that should be hidden from weary eyes. So the browser will not show the typed characters (or just briefly), but will show asterisks instead.

Username: <input type="text" name="username"><br>
Password : <input type="password" name="password"><br>
查看更多
登录 后发表回答