How can I get this code to execute even when the focused on the iframe?
<Script>
function check(){ alert("test"); }
</script>
<body onkeydown="check()";>
Onkeydown event only works when focus is not on iframe...<br>
<iframe src="about:blank" frameborder=1;> </iframe>
If the iframe is on a different domain than the hosting site you are out of luck. If not and you don’t have control over it, you are out of luck. Else you could modify the iframe page to listen for the
onkeydownevent and invoke a parent javascript function: