JSFiddle - React, Tailwind, and code Playground

by deepak sisodiya

HTML

<p style="background-color:#ff0000">This is a paragraph.</p>
<button id="return">Return background-color of p</button>
<button id="set">Set background-color of p</button>

JavaScript

/* jquery css() method
The css() method sets or returns one or more style properties for the selected elements.
*/

$("#return").click(function () {
    alert("Background color = " + $("p").css("background-color"));
});

$("#set").click(function () {
    $("p").css("background-color", "yellow");
});