键盘隐藏和执行链接
我在 html 代码中有一个链接,其中有 onclick 事件。
<a href="#" onclick="hidePopup();">Click</a>
填充文本后,当我单击 Click-link 时,键盘会隐藏,但 onclick 事件不会调用,然后我需要再次单击 click-link 来执行其事件。如何隐藏键盘并单击执行代码?
注意:链接位于 iframe 中。
I have a link in html code for which there is onclick event.
<a href="#" onclick="hidePopup();">Click</a>
After filling the text when I click the Click-link the keyboard hides but onclick event does not call, then I need to click the click-link again to execute its event. How to hide keyboard and execute code on single click?
Note: the link is in iframe.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我是否正确理解你的情况。我首先想到的是,您的 hidePopup() 函数是在主框架中定义的,您的链接位于 iframe 中,当您单击链接时,不会调用该函数。如果这是正确的,请尝试 window.parent.hidePopup() 而不是 hidePopup()。所以你的锚标记应该是
I am not sure if I understand your situation correctly. The first thing that comes to my mind is that your hidePopup() function is defined in the main frame and your link is in the iframe and when you click on the link this function doesn't get called. If this is correct try window.parent.hidePopup() instead of hidePopup(). So you anchor tag should be