JSFiddle - React, Tailwind, and code Playground
by rpflorence
HTML
<div id="parent">
<p id="el">
Paragraph and
<button id="child">Child</button>
</p>
</div>
CSS
#parent {
background: #ccc;
}
JavaScript
Element.implement({
unwrap: function(){
var parent = this.getParent();
parent.getChildren().inject(parent,'after');
parent.dispose();
return this;
}
});
window.addEvent('domready', function(){
$('child').addEvent('click', function(){
alert('did you keep it?');
});
$('el').unwrap();
});