Hello...
I am trying to change the parameter for a class of links I have on a page. Example:
<a href="test.php?p1=DYNA123&p2=STATIC_ON" class="changeMe">abc123</a>
<a href="test.php?p1=DYNA321&p2=STATIC_ON" class="changeMe">abc321</a>
<a href="#" onclick="changeStatic();return false;">change urls</a>
I would like to use javascript/jquery to change the p2 parameter for all links with the class "changeMe" so it would equal "STATIC_OFF" when the "change urls" link is clicked. I found a couple of examples going by the href id.
function changeStatic(){
var allLinks = $('.changeMe').attr('href');
var res = allLinks.replace('p2=STATIC_ON', 'p2=STATIC_OFF');
}
The above doesn't work...maybe I'll have to do some type of explode on href and find that param and replace it.
I appreciate any insight.
Thanks,
j