jQuery URL and jQuery tab id replacement

Hi guys,

I have tabs that are generated by a WordPress site builder (not my idea). They work, but the only issue it the tab id and hash urls are random string, this means that I am unable to share or link to certain tabs, e.g, www.mysite.co.za/careers/electrician#apply-now

I end up with a string like: www.mysite.co.za/careers/electrician#42343243

So what I am trying to accomplish to be able to replace that auto-generated onl-oad online with #apply-now

Here is my script so far, I am able to loop through the IDs, I simply want to say: From the array, find and replace id that matches url variable in this instance.

    /* Update Enquire #hash */
    var tab = $('#fusion-tab-enquirenow');
    var url = $(tab).attr('href');

    $(tab).prop("href", "#enquire-now");

    // find tab with id matching URL and replace id with #enquire-now
    $('.tab-pane').each(function() {
        //alert( this.id );

    });

Let me know if I am not making any sense.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.