JSFiddle - React, Tailwind, and code Playground

HTML

<div class="tree">		
<ul>
<li><span class="expand"></span><a>Level 1</a>
	<ul>
		<li><span class="expand"></span><a>Level 2</a></li>
		<li><span class="expand"></span><a>Level 2</a></li>
		<li><span class="expand"></span><a>Level 2</a></li>
		<li><span class="expand"></span><a>Level 2</a></li>
	</ul>
</li>
<li><span class="expand"></span><a>Level 1</a>
	<ul>
		<li><span class="expand"></span><a>Level 2</a>
		  <ul>
			 <li><span class="expand"></span><a>Level 3</a>
			    <ul>
				   <li><a>Level 4</a></li>
			    </ul>
		  </ul>
		</li>
		<li><span class="expand"></span><a>Level 2</a></li>
	</ul>
</li>
</ul>
</div>

CSS

.tree ul {
    list-style: none outside none;
}
.tree li a {
    line-height: 25px;
	vertical-align: middle;
}
.tree > ul > li > a {
    color: #3B4C56;
    font-weight: normal;
    position: relative;
    text-decoration: none;
	cursor:pointer;
}
.tree li.parent > a {
    padding: 0 0 0 15px;
}

.tree li.parent > span.expand{
    background-image: url("http://s14.postimg.org/pm9vrg3vh/plus_minus_icons.png");
    background-position: 0 center;
    display: block;
    height: 21px;
    float: left;
    margin: 0;
	content:"*";
    vertical-align: middle;
    width: 23px;
	cursor:pointer;

}

.tree ul li.active > span.expand{
    background-position: 25px center;
}

.tree ul li ul {
    border-left: 1px solid #D9DADB;
    display: none;
    margin: 0 0 0 12px;
    overflow: hidden;
    padding: 0 0 0 25px;
}
.tree ul li ul li {
    position: relative;
}
.tree ul li ul li:before {
    border-bottom: 1px dashed #E2E2E3;
    content: "";
    left: -20px;
    position: absolute;
    top: 12px;
    width: 15px;
}

JavaScript

$( document ).ready( function( ) {

    
 $( '.tree li' ).each( function() {
	if( $( this ).children( 'ul' ).length > 0 ) {
			$( this ).addClass( 'parent' );		   
	}
 });
				
				
 $( '.tree li.parent > span.expand' ).click( function( ) {
	$( this ).parent().toggleClass( 'active' );
	$( this ).parent().children( 'ul' ).slideToggle( 'fast' );
 });
				
								
 $( '.tree li' ).each( function() {
	$( this ).toggleClass( 'active' );
	$( this ).children( 'ul' ).slideToggle( 'fast' );
 });

});