Raghuram Banda <ra************@nokia.sify.net> writes:
I'm new programmer in JavaScript. Can any one help in creating a
checkbox (by default selected) from JavaScript
var cb = document.createElement("input"); // create input node
cb.type = "checkbox"; // set type
cb.name = "checkboxName"; // set name if necessary
cb.checked = cb.defaultChecked = true; // make it checked now and by default
formRef.appendChild(cb); // add it to some form
and creating Drop down
box (<select> ... </select>) from Javascript.
var se = document.createElement("select");
cb.name = "selectName";
se.options[0] = new Option("selection 1","value 1");
se.options[1] = new Option("selection 2","value 2");
se.options[2] = new Option("selection 3","value 3");
se.options[3] = new Option("selection 4","value 4");
formRef.appendChild(se);
Hope this helps.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'