JSFiddle - React, Tailwind, and code Playground

by David Marshall

HTML

<div class="col-sm-8 items">
    <div class="item">
        <h6>Dynamic Web Programming</h6>
        <img src="DynamicWebProgramming.jpg">
        <p>This book is a great tool for learning to develop Dynamic Web Pages.</p>  
         // This is the paragraph that is hidden and I want to show on mouseover
    </div>
</div>

JavaScript

$(document).ready(function() {
    $(".item p").hide();

    $(".item h6").hover(function() {
        $(this).toggleClass("mouseover");
        $(this).siblings().toggleClass("mouseover");
        $(this).siblings("p").show(); // This is where I want to call .show() for the  specific sibling
    },function(){
        $(this).toggleClass("mouseover");
        $(this).siblings().toggleClass("mouseover");
        $(this).siblings("p").hide();
    });

    $(".item p").click(function() {
        $(this).removeClass("mouseover");
        $(this).siblings().removeClass("mouseover");
    })
})