JSFiddle - React, Tailwind, and code Playground
HTML
<ul id="test">
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
JavaScript
$.extend(HTMLElement.prototype, {
destroy: function() {
$(this).remove();
},
update: function(value) {
this.innerHTML = value;
}
});
var li1 = document.getElementsByTagName('li')[0];
var li2 = document.getElementsByTagName('li')[1];
$(li1).click(function() {
$(this)[0].destroy();
});
$(li2).click(function() {
this.update('Test');
});