Problem with dynamically rendered radio buttons
I'm trying to dynamically render radio buttons. Here is my test code...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function writeRadio () {
var sp = document.getElementById("filterRow");
sp.appendChild(document.createTextNode("Pick me "));
var input = document.createElement("input");
input.type="radio";
input.name ="myradiobutton";
input.defaultValue = "value1"
sp.appendChild(input);
sp.appendChild(document.createTextNode(" or me "));
input = document.createElement("input");
input.type="radio";
input.name ="myradiobutton";
input.value = "value2";
sp.appendChild(input);
}
</script>
</head>
<body onLoad="writeRadio();">
<form name="bob">
<p id="filterRow"></p>
</form>
</body>
</html>
When rendered on the page, the radio buttons work fine in mozilla (Firefox) but will not select when clicked in Internet Explorer.
Any ideas would be greatly appreciated!
|