jquery.collection.js
function (prefix, obj) {
            if (!obj.attr('id')) {
                var generated_id;
                do {
                    generated_id = prefix + '_' + randomNumber();
                } while ($('#' + generated_id).length > 0);
                obj.attr('id', generated_id);
            }
            return obj.attr('id');
        }
function (prefix, obj) {
            if (!obj.attr('id')) {
                var generated_id;
                do {
                    generated_id = prefix + '_' + randomNumber();
                } while ($('#' + generated_id).length > 0);
                obj.attr('id', generated_id);
            }
            return obj.attr('id');
        }
function ( prefix , obj ) { if ( ! obj . attr ( 'id' ) ) { var generated_id ; do { generated_id = prefix + '_' + randomNumber ( ) ; } while ( $ ( '#' + generated_id ) . length > 0 ) ; obj . attr ( 'id' , generated_id ) ; } return obj . attr ( 'id' ) ; }
return an element's id, after generating one when missing
return an element s id after generating one when missing