JSFiddle - React, Tailwind, and code Playground
HTML
<button>Add line</button>
<button>Remove line</button>
<div id="p_wrap">
<p> Original Line </p>
<p> Original Line </p>
<p> Original Line </p>
</div>
JavaScript
$(document).ready(function(){
//Add line
$("button:nth-of-type(1)").click(function(){
$("#p_wrap").append("<p>New Line</p>");
});
//Remove line
$("button:nth-of-type(2)").click(function(){
$("p:last-of-type").remove();
});
//Hover effect
$("p").hover(
function(){
$(this).css("color", "red");
},
function(){
$(this).css("color", "black");
}
);
}); // Document Ready End