extend individual elements
Is it possible to extend individual elements? For example, add a function, whatever(), to all images with:
-
$("img").extend({
whatever: function(){
alert("it's an image!!!");
}
});
and all divs with:
-
$("div").extend({
whatever: function(){
alert("it's a div!!!1");
}
});
This is a bad example, because you could always just extend jQuery and have the watever() function test for the type of element, but you get the idea...
thanks