You can't add the checked attribute after the input has been created, it must be part of the createElement method.
Try this: var checked = ""; if ( parentListItem.className == "inherit" ) { checked = " checked"; } var newCheckbox = document.createElement( "<input type=checkbox name=itemToDeploy" + checked + ">"); newCheckbox.value = fileArray[ i ][ 1 ]; Darryl On 12/06/06, Taco Fleur <[EMAIL PROTECTED]> wrote: > > I have the following javascript > > var newCheckbox = document.createElement( "input" ); > newCheckbox.type = "checkbox"; > newCheckbox.name = "itemToDeploy"; > newCheckbox.value = fileArray[ i ][ 1 ]; > if ( parentListItem.className == "inherit" ) { > newCheckbox.checked = true; > } > alert( newCheckbox.checked ); > > Everything shows up as expected, except that the check box is not checked, > even though alert( newCheckbox.checked ); outputs true... > Does anyone have any idea what could cause this? > > Thanks in advance. > > -- > Taco Fleur - http://www.pacificfox.com.au > Web Design, Web development, Graphic Design and Complete Internet Solutions > an industry leader with commercial IT experience since 1994 … > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~---