Jinu Joseph Daniel
Jinu Joseph Daniel

Reputation: 6291

Events not firing on iframes

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

Answers (1)

Hakan Serce
Hakan Serce

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

Related Questions