jquery selector unable to find visible last-child

后端 未结 3 1815
误落风尘
误落风尘 2021-01-24 18:37

Here is my HTML:

&
3条回答
  •  悲哀的现实
    2021-01-24 19:04

    Try using .last() selector:

    Reduce the set of matched elements to the final one in the set.

    $( "table#dataTable.xLookup thead#PickerTHEAD tr th:visible" ).last()
    

    Because your last visible child is not last child in the DOM node.

    var a = $( "table#dataTable.xLookup thead#PickerTHEAD tr th:visible" ).last();
    
    console.log(a.html());
    
    
             ...
          
          ...
       
      Option ID My Description QTY Unit Price nj1 nj2

提交回复
热议问题