JSFiddle - React, Tailwind, and code Playground
by Boris Šuška
HTML
<p> <a href="http://google.com" target="_blank"><strong>Google</strong></a>
<strong>Strong text</strong>
</p>
JavaScript
$(document).ready(function () {
// Neprime pridani obsluhy udalosti
$('body').on('click.myevent', 'a', function(event) {
alert($(this).text());
event.preventDefault();
});
// jQuery < 1.7: $('a').live('click', function() {...})
// $('body').delegate('a', 'click', function() {...})
$('body').off('click.myevent', 'a');
$('a').click(function (event) {
$(this).parent().append($('<a href="http://seznam.cz" target="_blank">Seznam</a>'));
event.preventDefault();
});
// $('a').bind('click', function() {...})
// $('a').on('click', function() {...})
$('a').on('click.myevent', function(event) {
alert('Hello form A');
event.preventDefault();
});
$('a').off('click.myevent');
$('a').trigger('click');
// $('a').click();
});