jQuery Checkbox dynamically created with checked property -
$('<input>', { type: "checkbox", id: "checkbox" + value.attributename, name: "checkbox" + value.attributename, classname: required + " " + datatype, attributeid: value.attributeid, disabled: readonly, checked: (value.attributevalue != "0") ? "true" : "false" }).appendto(li); i dynamically creating checkbox element. need assign checked property or not. in code below, it's checked because property present.
help?
don't use string here, use boolean:
$('<input>', { type: "checkbox", id: "checkbox" + value.attributename, name: "checkbox" + value.attributename, classname: required + " " + datatype, attributeid: value.attributeid, disabled: readonly, checked: (value.attributevalue != "0") }).appendto(li); checked boolean property in dom, string of non-0 length "truey", meaning "false" true. instead set directly true or false, no strings.
Comments
Post a Comment