jQuery selector where text = some value

后端 未结 9 1115
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 17:12

I have an object (in this case a rating object from js-kit) that I want to make invisible if the rating value is \'unrated\'. I\'m having trouble with getting the right jQue

9条回答
  •  無奈伤痛
    2020-12-03 17:30

    Is there another way to select an element based on the text contents?

    Try this:

    $('.js-rating-labelText').filter(function(){
      return (/unrated/i).test($(this).text())
    }).css('visibility', 'hidden');
    

提交回复
热议问题