jquery select first child with class of a parent with class

后端 未结 4 1777
北荒
北荒 2021-01-01 10:27

How can i select only the first child of a particular class of a parent with a particular class for the purposes of clone()?

4条回答
  •  没有蜡笔的小新
    2021-01-01 10:59

    Use :first-child

    var form1 = $(this).closest('.sector_order').find(':first-child');
    

    OR .first()

    var form1 = $(this).closest('.sector_order').find('.line_item_wrapper').first();
    

提交回复
热议问题