开发者

keyboard hide and execute link

开发者 https://www.devze.com 2023-04-11 03:47 出处:网络
I have a link in html code for which there is onclick event. <a href=\"#\" onclick=\"hidePopup();\">Click</a>

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 c开发者_运维知识库lick the click-link again to execute its event. How to hide keyboard and execute code on single click?

Note: the link is in iframe.


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

<a href="#" onclick="window.parent.hidePopup();">Click</a>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号