<html> | |
<body> | |
<form id="a"><input type=radio name="one"></form> | |
<form id="b"><input type=radio name="one"><input type=text></form> | |
<script> | |
var v = document.getElementById('b'); | |
document.body.removeChild(v); | |
document.getElementById('a').appendChild(v.elements[0]); | |
document.write("There should be two elements in the first form and one in the second. The count in form one is " + | |
document.forms[0].elements.length + ", and the count in form two is " + v.elements.length + "."); | |
</script> | |
</body> | |
</html> |