Put var inside jquery :gt()

后端 未结 2 772
日久生厌
日久生厌 2021-01-12 02:17

I have a list set with display:none and some code to show item 3:

HTML:

  • item 1
  • item 2&
2条回答
  •  臣服心动
    2021-01-12 02:58

    You have to use double inverted comma for conacatination beacause you use double inverted comma for selector.

    Try this jquery code:

    $("li:gt("+item+"):lt(1)").show();
    

提交回复
热议问题