How i can get keydown event on iframe?
+3
A:
Adding event handler to an iframe using JQuery
$(document.getElementById('iframe_id').contentWindow.document).keydown(function() {
// my func
});
Ahmed
2009-07-29 09:40:53
+3
A:
You need to access the document of the iframe which is through the ContentWindow object
$(document.getElementById('IFrameId').contentWindow.document).keydown(function(){ alert('Key down!'); });
James
2009-07-29 09:42:30
A:
You can't handle events of iframe instead handles event of body of iframe's src page.
adatapost
2009-07-29 09:45:37