隐藏带有两个密码的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>
添加回答
举报
0/150
提交
取消