JSFiddle - React, Tailwind, and code Playground

by the_archer

HTML

<head>
    <title>JQuery Toggle Demo</title>
</head>
<body>
    <div id="box"></div>
    <a href="#">Click Me</a>
    <p> This is a paragraph</p>
    <p> This is a paragraph</p>
    <p> This is a paragraph</p>
    <p> This is a paragraph</p>
</body>

CSS

#box
{
    width:200px;
    height:200px;
    background:red;
}

.borderclass
{
    border: 5px solid black;
}

.highlight
{
    background: yellow;
}

JavaScript

$(function(){
    $('a').click(function(){
        //$('#box').toggle(4000); //Show/Hides
        $('#box').toggleClass('borderclass');
    });
    
    $('p').click(function(){
        $(this).toggleClass('highlight');
    });
});