I have this HTML structure
next() only returns the next element in the DOM if it matches the selector, otherwise it returns and empty object. So the only thing you could search for using next()
is the <label>
. Use this instead:
$('.cake_checkboxes:first').nextAll('.quantity').first()
jQuery Docs: nextAll()
siblings also work here
$('.cake_checkboxes:first').siblings('.quantity')