0

私はこれを解決するために多くの試みを試みましたが、できません:クリックvalue="password"value ="Confirm password" たときに値の型がtextからpassword

1 つのボックスを変更できましたが、1 つのボックスではありpasswordませんconfirm password。問題は、input[type="password"]1 つの位置しか追加できないためです。もう一方をクリックすると、confirm text box直接ジャンプしますpassword text box

HTML

<input type = "passwords" id="passwords" name="passwords" value ="Password" onclick="passwords();" />
    <input type = "confirm" id="confirm" name="confirm" value ="Confirm Password" onclick="confirms();" />

CSS

input[type="password"]
{
    background: transparent;
    border:none;
    color:#2185c5;
height:41px;
width:273px;
padding-left:35px;
border-radius:3px;
font-size:20px;
position:absolute;
top:690px;
left:353.5px;
position:absolute;
z-index:11;

    }

JS

function passwords()
{
    document.getElementById("passwords").value= "";
    document.getElementById('passwords').type = 'password';

}

function confirms()
{
    document.getElementById("confirm").value= "";
     document.getElementById('confirm').type = 'password';

    }
4

3 に答える 3

1
<input type="password" placeholder="password" />
<input type="password" placeholder="Confirm password" />
于 2013-06-23T11:56:38.147 に答える