3
How to create a parent tag within an element with jQuery, for example, having this original structure:
<p>texto</p>
After function jQuery would look like this:
<a href='#'>
<p>texto</p>
</a>
3
How to create a parent tag within an element with jQuery, for example, having this original structure:
<p>texto</p>
After function jQuery would look like this:
<a href='#'>
<p>texto</p>
</a>
5
You can do it like this:
$('p').wrapAll('<a href="#" />');
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p>texto</p>
Browser other questions tagged jquery
You are not signed in. Login or sign up in order to post.
Show man, thank you so much!
– Tales Breno
You’re welcome @Talesbreno
– Miguel