JSFiddle - React, Tailwind, and code Playground
by Mark Coleman
HTML
<div class="click">click me</div>
<div id="hide">some text</div>
CSS
#hide{
display:none;
}
JavaScript
var myjQuery = jQuery.sub();
myjQuery.fn.hide = function() {
alert('hide');
return jQuery.fn.hide.apply(this, arguments);
};
myjQuery.fn.show = function() {
alert('show');
return jQuery.fn.show.apply(this, arguments);
};
(function($) {
$(document).ready(function() {
$(".click").click(function() {
if ($("#hide").is(":visible")) {
$("#hide").hide();
}
else {
$("#hide").show();
}
});
});
})(myjQuery);