<section id="show-hide" class="animate-things-wrapper">
    <button id="trigger">Trigger</button>

    <div id="box" class="box">
        Hi there
    </div>
</section>

<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="../../js/components/show-hide.js"></script>
<section id="show-hide" class="animate-things-wrapper">
    <button id="trigger">Trigger</button>

    <div id="box" class="box">
        Hi there
    </div>
</section>

<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="{{ path '/js/components/show-hide.js' }}"></script>
/* No context defined. */
  • Content:
    (function () {
      document.addEventListener('DOMContentLoaded', function () {
        console.log("show-hide active");
    
        const $button = $('#trigger');
        const $box = $('#box');
    
        $button.click(function() {
          $box.toggle();
        });
      });
    })();
    
  • URL: /components/raw/show-hide/show-hide.js
  • Filesystem Path: components/02-jquery/01-show-hide/show-hide.js
  • Size: 251 Bytes

No notes defined.