我想在导航中弹出一个登录信息。我希望它不会回到上一页,只要我点击其中一个文本框,当我只点击退出或“x”按钮时它将退出。我不知道我的代码有什么问题。有人能帮助我吗?
<body>
<div class=MainNavi>
<div class=SecNavi>
<ul>
<div class="login">
<li> <a href="#form" Onclick="onClick(this)" id = "log101">Login</a>
<div id="m01" class="modal-popup" onclick="this.style.display='#form'">
<img class="modal-popup-content " id="img01" style="width:80%">
<div class="login-container">
<img src="images/user-login.png">
<div id = "form">
<form action="" method="post" id="myform">
<div class = "form-input">
<input type="text" name="username" value="" placeholder="Enter Username" required="required">
</div>
<div class = "form-input">
<input type="password" name="password" value="" placeholder="Enter Password" required="required">
</div>
<input type="submit" class=btn-login name="log" value="Let me in">
</div>
</form>
</div>
<span id ="x101"Onclick="onClick(this).this.style.display='none'"" class="x- btn x-hover display-x">x</span>
<script>
function onClick(element) {
document.getElementById("log101").src = element.src;
document.getElementById("m01").style.display = "block";
}
</script>
</div>
<li><a href="#">About Us</a></li>
<li><a href="#">Songs</a></li>
<li><a href="Gallery.htm">Gallery</a></li>
<li><a href="Home.htm">Home</a></li>
<center><h1>#</h1></center>
</ul>
</div>
</div>