0

Here is my code:

$("form").before().click(function () {
    $('.woocommerce_checkout_login p').toggleClass("show");
});

I want add the class just after click, but when I reload the page it add for a few seconds.

3
  • Not sure you're using before() properly, might be worth reviewing its doc Commented Mar 7, 2017 at 15:45
  • 3
    Your use of before() is suspect, and adding a click handler to a form is very odd too Commented Mar 7, 2017 at 15:47
  • Was exactly the before(). I change a few stuffs and works. Commented Mar 7, 2017 at 15:49

1 Answer 1

1

Why do you have a before() in your chain?

What you need is:

$("form").on('click', function() {
    $('.woocommerce_checkout_login p').toggleClass("show");
});
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I removed and work. Why the before element was making this happens?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.