$(element).wrapInner(Html)
Html Required. String that specifies the html code that will be warped inside the elment.
none
Tested successfully on: – Firefox > 1.x – Opera 8.54, Opera 9.0 Beta 2 – IE 5.5, IE 6.x, IE 7 Beta 2 – Safari 2.03
Download jquery-plugin-wrapinner.js (1kb uncompressed)
<p>Hello world!</p>
<script>
$('p').wrapInner('<a href="/"><\/a>');
</script>
Returns:
<p><a href="/">Hello world!</a></p>
Hello World!