Jquery next not finding the next div?

后端 未结 2 1350
北海茫月
北海茫月 2021-01-18 08:24

I have this HTML structure

Chocolate      
  

        
2条回答
  •  一整个雨季
    2021-01-18 08:37

    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 . Use this instead:

    $('.cake_checkboxes:first').nextAll('.quantity').first()
    

    jQuery Docs: nextAll()

提交回复
热议问题