JSFiddle - React, Tailwind, and code Playground

by i nenu love nennu

HTML

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Toggle class</button>
<p></p>
<div id="myid">
    
    this is the text which i want to change the css usign the jquery
    
</div>

<input type="button" id="changecss" value="change css">

CSS

.blue
{
   color:blue;
   font-size:12px;
    
}

JavaScript

$(document).ready(function(){
  
    $("button").click(function(){
  
      $("h1,h2,p").toggleClass("blue");
      
  });
    
    $("#changecss").click(function(){
    
        $("#myid").css("background-color","yellow");
        $("#myid").css("color","blue");
        
        
    });
    
});