On 15/08/06, John Resig <[EMAIL PROTECTED]> wrote:
> This is some great code - I really dig it. It's super simple, which is good.
>
> Just as a mini-tutorial to the upcoming 1.0b, here are some of the
> changes that are possible:
>
> jQuery.fn.checkbox = function (opt) {
> $("[EMAIL PROTECTED]'checkbox']", this).hide().each(function(){
> $("<img>")
> .src( this.checked ? opt.checked : opt.unchecked )
> .click( function() {
> var check = this.src == opt.checked;
>
> $(this)
> .src( check ? opt.unchecked : opt.checked )
> .next().attr( "checked", check ? "" : "checked" );
> }).insertBefore( this );
> });
> };
>
> I'm not saying that mine is any better - just using this as a
> demonstration of what's possible.
>
> --John
>
Does $("<img>") use DOM methods (i.e. document.createElement) or
innerHTML for creating elements?
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/