user2818430
user2818430

Reputation: 6029

jquery add multiple parameters to links within a div with specific id

I have a div:

<div id="links">
   <a href="http://something.domain.com">link></a>
   <a href="http://something.domain.com">link></a>
   <a href="http://something.domain.com">link></a>
   <a href="http://something.domain.com">link></a>
   ........
</div>

How can I add multiple parameters to these links from within div with id links?

EDIT:

So the links will be like this:

<a href="http://something.domain.com?param=1&param2=2&param3=3">link</a>

Upvotes: 0

Views: 50

Answers (1)

Anik Islam Abhi
Anik Islam Abhi

Reputation: 25352

try like this

$("#links a").each(function(){

    $(this).attr("href",$(this).attr("href")+"?param=1&param2=2&param3=3");

})

Upvotes: 2

Related Questions