Hi,
Sometimes, I find it necessary to generate an id for an element,
so I created the following little plugin.
I'm posting it here in case it may be of use to anyone else,
and as a possible candidate for jQuery core.
$.generateId = function() {
return arguments.callee.prefix + arguments.callee.count++;
};
$.generateId.prefix = 'jq$';
$.generateId.count = 0;
$.fn.generateId = function() {
return this.each(function() {
this.id = $.generateId();
});
};
Regards
- Mark Gibson
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/