Replace html tag with its content

by Joe Saad

HTML

<button>Replace now</button>
<span class="dhl">3213152221552</span>

JavaScript

$('button').click(function{
   $("span.dhl").each(function(){
    $(this).replaceWith($(this).html());
    });
});