5

Possible Duplicate:
How to change the href for a hyperlink using jQuery

I'm using Drupal and system generate my title.

E.G.

    <a class="jquery-once-3-processed" id="quicktabs-tab-galeri-1" 
href="/?q=node&amp;qt-galeri=1#qt-galeri">NEWS</a>

I want change this href link via jQuery. How can i do this? Thank you.

Community
  • 1
  • 1
Slaythern Aareonna
  • 353
  • 3
  • 9
  • 25
  • $("a#quicktabs-tab-galeri-1").attr("href", new_href); or $("a.jquery-once-3-processed").attr("href", new-href); both should do fine – Rahul Jan 03 '13 at 15:00

3 Answers3

13
$("#quicktabs-tab-galeri-1").attr("href", new_href);

That should do the trick for you.

jxpx777
  • 3,632
  • 4
  • 27
  • 43
5
$('#quicktabs-tab-galeri-1').attr('href', 'YOUR_NEW_HREF');

This selects the element with id quicktabs-tab-galeri-1 and changes its href attribute.

Pablo
  • 1,073
  • 8
  • 9
4

You can try:

$('#quicktabs-tab-galeri-1').attr("href", "http://yournewlink.com");
geedubb
  • 4,048
  • 4
  • 27
  • 38