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;
  }
  .foo {
    background-color: #eee;
  }
</style>
</head>
<body>
  <p>This page starts out with just one of the "an element" <code>div</code>s below, then clones it and removes the <code>foo</code> class via <code>element.removeAttribute("class");</code></p>
  <div id="original" class="foo">An element</div>
</body>
</html>
 
jQuery(function($) {
  var original = $("#original"),
      clone = original.clone();
  
  clone[0].id = "clone";
  clone.removeAttr("class");
  
  clone.appendTo(document.body);
});
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers