JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js""></script>
<h3>PreventDefault() test</h3>
<ul id="tasks">
<li><a class="delete" href="https://api.jquery.com/on/">delete 0</a></li>
</ul>
CSS
body { font-family: verdana; }
JavaScript
$('#tasks').on('click', '.deleteTask', function(event) {
alert('Click event');
event.preventDefault();
});
for(var i = 1; i < 4; i++)
{
$('#tasks').append('<li><a class="delete" href="https://api.jquery.com/on/">delete ' + i + '</a></li>');
}