I’m trying to add a select box dynamically to a page with two radio boxes, but the firefox behaviour is strange. Although the first radio button explicitly defined as checked, but selected changes when the page is refreshed (with F5).
The complete html is (view it here):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
<form>
<div id="txt0"></div>
<input value="10" type="radio" name="a" checked="checked">
<input value="11" type="radio" name="a">
</form>
<script type="text/javascript">
window.onload = function(){
document.getElementById('txt0').innerHTML = '<select name="sa"></select>';
};
</script>
</body>
</html>
It looks like some kind of cache problem. Did some testing:
separate div didn’t work
checkedorchecked=truedidn’t workdocument.forms[0].a[0].checked = 'checked'worked(doh!)Anyway, it is a recognised Firefox problem, so the only thing you can do is use one of the workarounds you find above and wait until ff solves it.