Access Iframe Content in jQuery JavaScript
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#getIframeContent" ).on( "click", function(event) { var iframeContent = document.getElementById('myIframe').contentWindow.document.body.innerHTML; $("#iframeoutput").html(iframeContent); }); }); </script> </head> <body> <iframe id="myIframe" src="http://runtest.tutorialsplane.com/ionic/try.php?trycode=ionic-change-background-color-of-list-item&post_code=code5&full="> </iframe> <h4 ><a href="javascript:void(0);" id="getIframeContent">Get Iframe Content </a></h4> <h4>Iframe Content</h4> <div id="iframeoutput"></div> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#getIframeContent" ).on( "click", function(event) { var iframeContent = document.getElementById('myIframe').contentWindow.document.body.innerHTML; $("#iframeoutput").html(iframeContent); }); }); </script> </head> <body> <iframe id="myIframe" src="http://runtest.tutorialsplane.com/ionic/try.php?trycode=ionic-change-background-color-of-list-item&post_code=code5&full="> </iframe> <h4 ><a href="javascript:void(0);" id="getIframeContent">Get Iframe Content </a></h4> <h4>Iframe Content</h4> <div id="iframeoutput"></div> </body> </html>
Copyrights@tutorialsplane.com