JSFiddle - React, Tailwind, and code Playground
by Deliveron
HTML
<div id="container">
<p class="add">
This paragraph is wired up with the .bind 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').bind('click', function() {
$(this).after('<p class="add">This paragraph was added dynamically, but it does not have an event handler attached to it</p>');
});