|
Had a bit of a play. Looks like you cant
set the “checked” property for the checkbox until its been written
to the page like this var newCheckbox = document.createElement(
"input" ); newCheckbox.type = "checkbox"; newCheckbox.name =
"itemToDeploy"; newCheckbox.value = "somevalue";
document.body.appendChild(newCheckbox) newCheckbox.checked = true; otherwise use a string to create the
checkbox element like this var newCheckbox =
document.createElement("<input type=\"Checkbox\"
name=\"itemToDeploy\" value=\"somevalue\"" +
(parentListItem.className == "inherit" ? "checked" :
"") + ">" ) document.body.appendChild(newCheckbox) Steve From: I have the following _javascript_ var newCheckbox =
document.createElement( "input" ); 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.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~--- |
- [cfaussie] [OT] javascript checked attribute Taco Fleur
- [cfaussie] Re: [OT] javascript checked attribute Steve Onnis
- [cfaussie] Re: [OT] javascript checked attribute darryl lyons
