隐藏带有两个密码的DIV元素

隐藏带有两个密码的DIV元素


我是新手,需要使用多个密码。如何使用多个密码


我不知道该如何改变。


#HIDDENDIV {

    display: none;

}


#table td {

    padding: 1em;

    border: 1px solid black;

}



#table.show tr > *:nth-child(2) {

    display: block;

}

<div id="passw">

            <div>

                (THE PASSWORD IS PASSWORD) <br />

                Enter the password to proceed:

            </div>

            <div>

            

                <input type="password" id="password" onkeydown="if (event.keyCode == 13) document.getElementById('button').click()" /> <!-- IMPORTANT! this part is so if you click enter, it works. -->

                </div>

            


            <div>

                <br/>

                <input id="button" type="button" value="Login" onclick="if (document.getElementById('password').value == 'PASSWORD') { 

document.getElementById('table').classList.toggle('show');   document.getElementById('passw').style.display='none'; } 

else {  alert('Invalid Password!'); password.setSelectionRange(0, password.value.length);   } " />

            </div>

<!-- it will autoselect wrong input if wrong -->

    <br /><br /><br />

        </div>


<table id="table">

    <tr> 

        <td>stuff</td>

        <td id="HIDDENDIV" >hidden stuff</td>

    </tr>

</table>


慕桂英546537
浏览 105回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript