Link to home
Start Free TrialLog in
Avatar of badwolfff
badwolfffFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Why is this jQuery not working?

Avatar of hielo
hielo
Flag of Wallis and Futuna image

The general syntax is: $('.selector', 'context'); So, target '.quantity-adder' (the selector) within the closest('.qty') (the context):
$('.quantity-adder', $('button:contains("Avvisami quando questo articolo diventa disponibile")').closest('.qty') ) .hide();
Avatar of badwolfff

ASKER

Excellent! It works... however since I wasn't expecting the code to be in this format (selector/context), I would like to ask you how I could convert this string in the jquery each format as I have several similar cases on the same page.
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:)