I have an accordian on a page I am building at https://therussellcons.wpengine.com/services/ and I am trying to add a hyperlink to the "Train the Trainer" title, but can’t seem to figure it out. The title has an empty href
since it is used to fire the opening of the accordion, but I need this particular accordion to link to an external url. I’ve tried many different things, but below is what I’ve tried last with no luck.
jQuery(document).ready(function(){
jQuery("#elementor-tab-title-1832").click(function(){
$("a.elementor-accordion-title").attr("href", "https://www.test.com");
});
});
3
Answers
You can put the
onclick
attribute in your a tag, like this:If the number of tab titles is a lot and differents, use a variable like
redirectUrl
.Then handle the click event on link by js:
You have to click twice with this code to get it to work. Is there some other way to do this?