0

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>
3
  • What do you mean by parameters? Commented Aug 11, 2015 at 20:52
  • I edited my question Commented Aug 11, 2015 at 20:54
  • Are the params going to be the same for each link? Commented Aug 11, 2015 at 20:55

1 Answer 1

2

try like this

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

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

})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.