JSFiddle - React, Tailwind, and code Playground

by simoncereska

HTML

<h2></h2>
<span>Lorem ipsum</span>

<p><a href="#">Remove bg</a>

CSS

h2   { background: #000; width: 100px; height: 100px; }
span { position: absolute; z-index: 0; display: none; }

JavaScript

var pos = $('h2').offset();

$('span').css({'width': $('h2').outerWidth(), 'height': $('h2').outerHeight(), 'left': pos.left(), 'top': pos.top(); })


$('a').click(function() {
    $('h2').css({'background': 'transparent'});
    return false
});