JSFiddle - React, Tailwind, and code Playground

by mrtsherman

HTML

<h1>Level 1 Header</h1>
    <h1>My Second Level 1 Header</h1>
    <h1>And a third for kicks</h1>
    
    <h2>Level 2 Header</h2>
    <h2>2nd Level 2 Header</h2>
    
    <p>Here is a paragraph.</p>
    <p>Here is a paragraph number 2.</p>
    <p>And paragraph number 3.</p>
    
    <ul>
        <li>list item 1</li>
        <li>list item 2</li>
        <li>list item 3</li>
        <li>list item 4</li>
    </ul>

JavaScript

$('h1').each( function() {
    var foo = $(this).not(":first-child");
    //alert(foo.length);
    //alert($(this).html());
    
});


$('body').children().each(function() {
    if ($(this).not(":first-child").length != 0) {     
        $(this).slideUp(); 
        //alert($(this).html());
    }
});