Answers for "javascript iframe listener"

1

how to add event listener to iframe

var iframe = document.getElementById('myIFrame');
iframe.contentWindow.body.addEventListener('mouseup', Handler);

function Handler() {
    alert('works');
}
Posted by: Guest on July-18-2020
0

javascript iframe listener

window.addEventListener('load', (event) => {

var ifrm = = document.getElementById('myIFrame');
  
ifrm.contentWindow.document.addEventListener('mouseup', Handler);

function Handler() {
    alert('works');
}

});
Posted by: Guest on July-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language