我有以下代码:
<div class="popup" onclick="myFunction()">
<span style="color: #17304b;">
<strong><em>Read More</em></strong>
</span>
<span class="popuptext" id="myPopup">
[contact-form-7 id="0001" title="245 Mathews Apartments"]
</span>
</div>
JavaScript的:
function myFunction() {
setTimeout(popup, 3000);
var popup = document.getElementById('myPopup');
popup.classList.toggle('show');
}
但是,当它打开弹出窗口时,当您单击表单以填充字段时,它会再次关闭。你能帮帮我吗?如何仅在单击主体而不是单击表单时关闭弹出窗口?