Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keydown event on a iframe

Tags:

jquery

How i can get keydown event on iframe?

like image 465
pradeep Avatar asked Jul 29 '09 09:07

pradeep


1 Answers

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!'); });

Make sure you bind the event after the frame has loaded.

like image 196
James Avatar answered Nov 07 '22 23:11

James