@aniya.jaskolski
You can check if an iframe is loaded in JavaScript by using the load
event listener on the iframe element. Here's an example:
1 2 3 4 5 |
var iframe = document.getElementById('myIframe'); iframe.onload = function() { console.log('iframe is loaded!'); }; |
In this example, we are adding an onload
event listener to the iframe element with the ID myIframe
. When the iframe is fully loaded, the console will display "iframe is loaded!". This is a simple way to check if an iframe is loaded in JavaScript.