jQuery: The Write Less, Do More JavaScript Library

 « Return to Thread: How to update check boxes in code

Re: How to update check boxes in code

by Karl Swedberg-2 :: Rate this Message:

Reply to Author | View in Thread

you are trying to set a dom property on a jQuery object.

for the second line, either do:

 chk[0].checked = true;

or: 

 chk.attr('checked', true);


--Karl

____________
Karl Swedberg




On Jul 2, 2009, at 3:45 PM, Arne Garvander wrote:


This code does not work
var chk = $('#frmCoverage:checkbox');
 chk.checked = true;

What am I doing wrong?

 « Return to Thread: How to update check boxes in code