你好,你的代码非常好,但这并不完全是正确的代码写在下面<script type="text/javascript"> var password = "gloryOfSameer"; while (k != password) { var k = prompt("Enter password"); if(k==password){alert('correct password click ok to continue')} else if (k != password) { alert("Wrong password!"); }}