我在创建一个小型对话框时遇到了问题,当我点击图片时它不会弹出来。现在我的弹出内容只会显示在图片下方。以下是我的代码:
function showpopup() {
document.getElementById("popupwindow").classList.toggle("hidden");
}
<style>
.hidden {display:none}
</style>
<span class="profile"><img width="200" height="200" src="http://i.stack.imgur.com/o2hxa.png" style="margin-top: 30px;" onclick="showpopup()"></img></span>
<div id="popupwindow" class="hidden">
<p style="color:black;">LMS short explanation</p>
</div>