Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Example</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
  body {
    font-family: sans-serif;
  }
</style>
</head>
<body>
  <input type="button" id="theButton" value="Click Me">
</body>
</html>
 
jQuery(function($) {
  var counter = 0;
  
  $("#theButton").click(function() {
    display("Loading the iframe...");
    var $iframe = $("<iframe>");
    $iframe
      .css({
        position: "absolute",
        left: "-10000px"
      })
      .bind("load", function() {
        var doc = $iframe[0].contentDocument,
            html = doc && doc.documentElement,
            lang = html && html.getAttribute("lang");
        if (lang) {
          display("<code>lang = " + lang + "</code>");
          $iframe.remove();
        }
      })
      .appendTo(document.body);
    $iframe[0].src = "http://jsbin.com/imeqij";
  });
  
  function display(msg) {
    $("<p>").html(msg).appendTo(document.body);
  }
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers