jquery wrap inner text

JavaScript
$("button").click(function(){
  $("p").wrapInner("<b></b>");
});

/*
Before:
<p>Hello World!</p>

After:
<p><b>Hello World!</b></p>
*/
Source

Also in JavaScript: