jQuery(document).ready(function (e) {
focus();
var listener = addEventListener('blur', function() {
if(document.activeElement === document.getElementById('my_iFrame')) {
console.log("clicked!");
}
removeEventListener(listener);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<iframe src="http://example.com" id="my_iFrame"></iframe>
此代码只计算一次。如何计算更多点击次数?
谢谢!