JSFiddle - React, Tailwind, and code Playground

by Kelly Hawker

HTML

<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<div class="eventText">
    <h3>
        EVENT ONE
    </h3>
    <p><b>This is event one</b>
        
    </p>
    <div class="exPanel">
        More information
    </div>
    <a href="#" class="eventLink">FIND OUT MORE</a>
</div>
<div class="eventText">
    <h3>
        EVENT TWO
    </h3>
    <p>
        <b>This is event two</b>
    </p>
    <div class="exPanel">

    </div>
    <a href="#" class="eventLink">FIND OUT MORE</a>
</div>
<div class="eventText">
    <h3>
        EVENT THREE
    </h3>
    <p>
        <b>This is event three</b>
    </p>
    <div class="exPanel">
        More information
    </div>
    <a href="#" class="eventLink">FIND OUT MORE</a>
</div>

JavaScript

$('.eventText').each( function () {
  console.log($('.exPanel', this));

  if(!$.trim($('.exPanel', this).html())) {
      $('a.eventLink', this).hide();
  }
});