Clear iframe using jquery - Javascript jQuery

Javascript examples for jQuery:iframe

Description

Clear iframe using jquery

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.2.js"></script> 
  <script type="text/javascript">
    $(function(){/*from www .  j av a 2  s  . c o m*/
$("#btn").click(function(){
    $("#ifrm").attr("src", "about:blank");
});
    });

      </script> 
 </head> 
 <body> 
  <iframe id="ifrm" src="http://www.google.com"></iframe> 
  <input id="btn" type="button" value="&quot;close&quot; page">  
 </body>
</html>

Related Tutorials