jquery select first child with class of a parent with class

后端 未结 4 1750
北荒
北荒 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:52

    Try this:

    var $firstDiv = $(".sector_order > .line_item_wrapper:eq(0)");
    

    This will get you the first direct descendant of sector_order with the class line_item_wrapper.

    Example fiddle

提交回复
热议问题