I
Iain Downie
Dear List,
I have a snippet of code below that creates a new input element for a
checkbox and sets some attributes.
var observationCheckbox = document.createElement('input');
observationCheckbox.setAttribute('type', 'checkbox');
observationCheckbox.setAttribute('id', 'observation.' + runningCount +
'.species');
observationCheckbox.setAttribute('name', 'observation.' + runningCount +
'.species');
observationCheckbox.setAttribute('value', 's' + speciesCode);
Question: Is it possible to set this checkbox to be 'checked' when it is
created? I'm not sure if this constitutes an attribute or not.
Thanks
Iain
www.bto.org/birdweb
I have a snippet of code below that creates a new input element for a
checkbox and sets some attributes.
var observationCheckbox = document.createElement('input');
observationCheckbox.setAttribute('type', 'checkbox');
observationCheckbox.setAttribute('id', 'observation.' + runningCount +
'.species');
observationCheckbox.setAttribute('name', 'observation.' + runningCount +
'.species');
observationCheckbox.setAttribute('value', 's' + speciesCode);
Question: Is it possible to set this checkbox to be 'checked' when it is
created? I'm not sure if this constitutes an attribute or not.
Thanks
Iain
www.bto.org/birdweb