For me, one of the best, yet under-utilised feature of jQuery is the custom selector. I have a fairly trivial example of this, to pick out all text boxes that are empty:
$(document).ready(function() {
$.extend($.expr[':'], {
textboxEmpty: function(el) {
var $el = $(el);
return ($el.val() == "") && ($e...
As the title states. I'm using jQuery to do the magic. I've used a custom Contains extension to the selectors as follows:
jQuery.expr[':'].Contains = function(a, i, m) {
return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
};
which I found on the interwebs. It works fine. I'm using it in conjunction with the ...
It's my understanding that, in terms of selector speed, that #ID selectors are fastest, followed by element selectors, and then .class selectors.
I have always assumed that pseudo-class selectors and custom selectors (those in the form ':selector') are similar to .class selectors, but I realised that I'm just not sure.
I realise that t...