Reputation: 6291
I have included an iframe in my page and added a keypress event like this
<iframe src = 'mySrchere.com' onkeypress = 'alert(8)'></iframe>
But the event is not triggering.?Why is this happening ..So I cannot attach an event with an iframe? Is it because it is another document?
Upvotes: 1
Views: 221
Reputation: 11256
The problem is this: iframe
tag does not support onkeypress
. You can see the list of tags applicable for onkeypress
here : http://www.w3schools.com/jsref/event_onkeypress.asp
Upvotes: 1