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>
精彩评论