JSFiddle - React, Tailwind, and code Playground
by GopsAB
HTML
<div class="a">123213123</div>
<input class="bt1" type="button" value="click1"/>
<input type="button" value="click2" class="bt2"/>
CSS
.a
{
border: 1px solid red;
width:100px;
height:100px;
}
.b
{
border: 1px solid blue;
width:100px;
height:100px;
}
JavaScript
$('.bt1').click(
function()
{
alert('1');
$('.a').toggleClass('b');
}
);
$('.bt2').click(
function()
{
$('body').html('<div class="a">123213123</div><input class="bt1" type="button" value="click1"/><input type="button" value="click2" class="bt2"/>');
}
);