tags:

views:

49

answers:

2

I'm aware of jQuery's append() which appends html inside the selected element. I want to add more html after the selected element. For instance:

<a href="/somewhere/">Somewhere</a>

I want to add the html <h3>Hello</h3> after the above to become:

<a href="/somewhere/">Somewhere</a>
<h3>Hello</h3>

How can you achieve that in jQuery?

+7  A: 

after

Galen
A: 

To address your problem, here is the full code:

$('a[href=desired_url]').after('<h3>Hello</h3>');
Thariama