I would like to use Jquery to add a class to \"li\" element that contains a \"span\" element with a html/val equal to zero.
For Example if my code looks like this:
Try:
$('li span.num').filter( function(i){ return $(this).text() == '0'; }).closest('li').addClass('selected');
JS Fiddle demo.