Add css class depending on link [closed]

SouljaGirl

New Member
I was wondering if someone can write me a simple example of javascript code in which you can add specific css class depending on link (url) clicked.page one - \[code\]<a href="http://stackoverflow.com/questions/14578236/www.link.com?id=something1">Link 1</a><a href="http://stackoverflow.com/questions/14578236/www.link.com?id=something2">Link 2</a>\[/code\]page two\[code\]<div class="style1">Some content1</div><div class="style2">Some content2</div>\[/code\]After clicking on Link 1 result on page 2 should be \[code\]<div class="style1 add1">Some content</div><div class="style2">Some content2</div>\[/code\]After clicking on Link 2 result page 2 should be\[code\]<div class="style1">Some content</div><div class="style2 add2">Some content2</div>\[/code\]Thank you for help!
 
Back
Top