[jQuery] Getting checked/disabled Attributes using attr()
Sweet! Works like a charm- thank you very much, Erik.
Michael
> -----Original Message-----
> From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On
> Behalf Of Erik Beeson
> Sent: Monday, March 12, 2007 2:23 PM
> To: jQuery Discussion.
> Subject: Re: [jQuery] Getting checked/disabled Attributes using attr()
>
> Assuming your checkbox is called 'cb' and your submit button is called
> 'sub', try this:
>
> $(function() {
> $('#cb').click(function() {
> if($(this).is(':checked')) {
> $('#sub').removeAttr('disabled');
> } else {
> $('#sub').attr('disabled', 'disabled');
> }
> });
> });
>
> --Erik
>
>
> On 3/12/07, Michael E. Carluen <cf_mecarluen@comcast.net>