jQuery update link
- by Happy
Here is html:
<a href="http://site.com/any/different/folders/picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/some_other_name.png">Go and win</a>
How to add some text after last "/" in href attribute (before picture_name.jpg) of each link?
The script should give something like:
<a href="http://site.com/any/different/folders/user_picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/user_some_other_name.png">Go and win</a>
Here user_ is added.
There can be any length of the link.