JSFiddle - React, Tailwind, and code Playground
by Deliveron
HTML
<div id="container">
<p class="add">
This paragraph is wired up with the .live method. Clicking it will add another paragraph.
</p>
</div>
CSS
p.add {
background: red;
cursor: pointer;
padding: 6px;
margin: 8px;
color: white;
border-radius: 6px;
}
JavaScript
$('#container p.add').live('click', function() {
$(this).after('<p class="add">This paragraph was added dynamically and it also has a click handler attached to it. Clicking this paragraph will also add a new paragraph.</p>');
});