Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html>
<head>
    <meta charset=utf-8 />
    <title>jQuery 1.11 HTML5</title>
    
    <style type="text/css">
        div.test section { background:#f0f; display:block; }
    </style>
    
    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
    
    <script>
        jQuery(function ($) {
            $('#article').append($('div').clone().addClass('test'));
          
          $('#article section').each(function () {
            console.log(1);
            $(this).replaceWith(this);
          })
        });
    </script>
</head>
<body>
    <article id="article"><div><section>This section should have a pink background.</section></div></article>
</body>
</html>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers