It's worth a shot. I'm going to try that and let you all know how it works out.
Sent from my iPhone Shawn Stringfield Senior Interactive Media Designer (202) 215-1120 [email protected] http://www.deep6studio.com On Jan 18, 2011, at 5:23 AM, Mathias Schäfer <[email protected]> wrote: > 2011/1/18 Diego Perini <[email protected]>: >>> $('#my-check-box').attr('checked', true); -> should work cross browser if >>> it is a checkbox. >>> >>> and you can check if a checkbox is checked by using >>> `$('#my-check-box').is(':checked')`... >>> >> >> these two $() statements alone deserve a long chapter by themselves to >> exactly explain all the inconsistencies that may arise by using them >> together (probably even for checkboxes). > > I'm aware of the DOM properties vs. HTML attributes problem in general > but could you please elaborate the inconsistencies in this specific > case. What jQuery actually does here is elem['checked'] = true (cf. > line 1749 of jQuery 1.4.4) and elem.checked === true (cf. line 3573). > That's the recommended way, isn't it? > > Regards > Mathias > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected] -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
