<html>
<head>
<script type="text/javascript">
function createCheckBox()
{
var myCheckBoxUnchecked = document.createElement("input");
myCheckBoxUnchecked.setAttribute("type","checkbox");
myCheckBoxUnchecked.setAttribute("value","checkbox");
var myCheckBoxChecked = document.createElement("input");
myCheckBoxChecked.setAttribute("type","checkbox");
myCheckBoxChecked.setAttribute("value","checkbox");
myCheckBoxChecked.checked = true;
var handler = document.getElementById("LoadCheckbox");
handler.appendChild(myCheckBoxUnchecked);
handler.appendChild(myCheckBoxChecked);
}
</script>
</head>
<body>
<input type="button" value="Create Checkbox" onClick="createCheckBox()" />
<div id="LoadCheckbox"></div>
</body>
</html>
Dynamically add check box using javascript
Subscribe to:
Posts (Atom)