JSFiddle - React, Tailwind, and code Playground

by kapilrc

HTML

<!-- JavaScript & jQuery Tutorial for Beginners - 1 of 9 - Getting Started  -->

<h1>Click one </h1>
<p>you have clicked one</p>
<h1>Click two </h1>
<p>you have clicked two</p>

<h1>Click three </h1>
<p>you have clicked three</p>

CSS

h1 {
    cursor: pointer;
}

JavaScript

$(document).ready(function() {
	// hide the P tags
	$('p').hide();
    
    $('h1').click(function() {
          $(this).next().slideToggle(); 
    });


});