Skip to content

Instantly share code, notes, and snippets.

@tevashov
Last active October 27, 2022 21:43
Show Gist options
  • Select an option

  • Save tevashov/5172463 to your computer and use it in GitHub Desktop.

Select an option

Save tevashov/5172463 to your computer and use it in GitHub Desktop.
Write your own selectors #jQuery
//extend the jQuery functionality
$.extend($.expr[':'], {
//name of your special selector
moreThanAThousand : function (a){
//Matching element
return parseInt($(a).html()) > 1000;
}
});
$(document).ready(function() {
$('td:moreThanAThousand').css('background-color', '#ff0000');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment