How to append html to first occurance of string after selected element
- by uku
Hello,
I have html like so:
<div class=foo>
(<a href=forum.example.com>forum</a>)
<p>
Some html here....
</div>
And I want to insert another link after the first one, like so:
<div class=foo>
(<a href=forum.example.com>forum</a>) <a href=blog.example.com>blog</a>
<p>
Some html here....
</div>
...but because it is enclosed in () I cannot use:
$('div.foo a:first').append(' <a href=blog.example.com>blog</a>');
...which would place it before the ).
So how can I extend my jQuery selection to select the literal ) or do I need to use another solution?