Answers for "js target an iframe"

7

how to get element in iframe using javascript

const iframe = document.getElementById("myIframe");

const iWindow = iframe.contentWindow;
const iDocument = iWindow.document;

// accessing the element
const element = iDocument.getElementsByTagName("p")[0];
element.style.color = "green";
Posted by: Guest on October-21-2021
0

detect iframe content change javascript

$('#iframe').on('load', function() {
    alert('frame has (re)loaded ');
});
Posted by: Guest on September-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language