Adding second on.("click") event on page
-
Hi Guys,
Just a quick question regarding adding a second link click using Jquery. As I recently found out that onclick="open('link')" does not work in IE or Microsoft Edge, I am trying to replicate this using Jquery. The onclick option works perfect on everything else however I ideally need this to work across all browsers.
My issue is that this link sits within an accordion and so when the accordion is activated, the link within it is showing up when you hover over it however when you click on it, it just does not load and produces an error in inspector.
The link is here - the example is on the first drop down and the second 'book now' link.
My CSS for the 'book now' link is:
jQuery(document).on("click", ".book", function(e) {
e.preventDefault();
var id = jQuery(this).attr('href');
});And the HTML for the 'book now' link is
<a href="https://www.onetournament.uk/booking-form" class="book">Book now</a>
As always any help would be massively appreciated.
Cheers
Chris
-
-
Hi @mariusjopen
I have tried just a normal link however I have the same problem where it will show it is a link, however when you click on it, it does nothing and I get errors in inspector. I'm presuming this is because they are within the accordion?
The below image is the error I'm getting if its any help?

Cheers
Chris
-
-
Of course you will still need to adjust the jQuery to the Laytheme:
http://laytheme.com/documentation.html#custom-javascriptBest!
Marius
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login