Hi there,
I have the below code. it s a stripped down basic of a php file.
What is attached is simply supposed to switch a border on ad off depending on the status of a check box.
It runs fine in all browsers but in IE , nothing.
Has anyone got any ideas cause ive been pulling y hair out on this for a number of hours now.
cheers
steve
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
.itemgroup {
border:1px solid #FFFFFF;
}
.itemgroup_show {
border:1px solid #0000FF;
}
</style>
<script type="text/javascript">
function show_groups() {
var check_status = document.getElementById('group_outlines');
if(check_status.checked) {
var items_to_show = document.getElementsByTagName("div");
for(var i=0; i< items_to_show.length ; i++) {
var class_text = items_to_show[i].getAttribute("class");
if(class_text == "itemgroup") {
items_to_show[i].setAttribute("class" , "itemgroup_show");
}
}
}
if(!check_status.checked) {
var items_to_show = document.getElementsByTagName("div");
for(var i=0; i< items_to_show.length ; i++) {
var class_text = items_to_show[i].getAttribute("class");
if(class_text == "itemgroup_show") {
items_to_show[i].setAttribute("class" , "itemgroup");
}
}
}
}
</script>
</head>
<body>
<ul class='sortabledemo' id='groupUL2'>
<li id='groupUL2_groupUL21'>
<div class="itemgroup_show">
hello there
</div>
</li>
</ul>
<div id="right" align="right">
<fieldset id="display" class="fieldSetBorder">
<legend class="leg">Display</legend>
<input name="group_outlines" type="checkbox" id="group_outlines" onClick="show_groups();" checked="checked" />
<label for="group_outlines">Show group outlines</label>
<br />
</fieldset>
</div>
</body>
</html>
|