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
You can create your own selector methods
For example, if you want to be able to do the following:
$('.js-rating-label:hasText(unrated)');
You can define the hasText method as follows
$.expr[':']['hasText'] = function(node, index, props){
return node.innerText.contains(props[3]);
}
props[3] contains the text inside the brackets after ':hasText'.