I need to get the below mentioned code working in IE9,it works absolutely fine with Firefox.
I have included the DOCTYPE,meta for ie9,set the browser mode to IE9 Compatibility view and Document mode to IE9,but it still doesn't work.
Any help would be appreciated.
CSS code:clmenu.css
.mC {width:100px; margin:5px; float:right;}
.mH {color:#60c; cursor
ointer; font-weight:bold; border-top:1px solid #300;}
.mL {display:none; margin-bottom:10px;}
.mO {margin-left:10px; display:block;}
Javascript: clmenu.js
function toggleMenu(objID) {
if (!document.getElementById) return;
var ob = document.getElementById(objID).style;
ob.display = (ob.display == 'block')?'none': 'block';
}
HTML: clmenu.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Strict//EN"
"http://www.w3.org/TR/html1/DTD/html1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="en-us" />
<script src="clmenu.js" type="text/javascript"></script>
<link href="clmenu.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="mC">
<div class="mH"
onclick="toggleMenu('menu1')">+ Collapsible</div>
<div id="menu1" class="mL">
<a class="mO" href="blclmenu1.htm">Head Script</a>
<a class="mO" href="blclmenu2.htm">Stylesheet</a>
<a class="mO" href="blclmenu3.htm">Add Menus</a>
</div>
<div class="mH"
onclick="toggleMenu('menu2')">+ Dropdown</div>
<div id="menu2" class="mL">
<a class="mO" href="blmenu.htm">Introduction</a>
<a class="mO" href="blmenu1.htm">Head Script</a>
<a class="mO" href="blmenu2.htm">Customize</a>
<a class="mO" href="blmenu3.htm">Body Script</a>
</div>
</div>
<body>
</html>
I have included the DOCTYPE,meta for ie9,set the browser mode to IE9 Compatibility view and Document mode to IE9,but it still doesn't work.
Any help would be appreciated.
CSS code:clmenu.css
.mC {width:100px; margin:5px; float:right;}
.mH {color:#60c; cursor

.mL {display:none; margin-bottom:10px;}
.mO {margin-left:10px; display:block;}
Javascript: clmenu.js
function toggleMenu(objID) {
if (!document.getElementById) return;
var ob = document.getElementById(objID).style;
ob.display = (ob.display == 'block')?'none': 'block';
}
HTML: clmenu.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Strict//EN"
"http://www.w3.org/TR/html1/DTD/html1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="en-us" />
<script src="clmenu.js" type="text/javascript"></script>
<link href="clmenu.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="mC">
<div class="mH"
onclick="toggleMenu('menu1')">+ Collapsible</div>
<div id="menu1" class="mL">
<a class="mO" href="blclmenu1.htm">Head Script</a>
<a class="mO" href="blclmenu2.htm">Stylesheet</a>
<a class="mO" href="blclmenu3.htm">Add Menus</a>
</div>
<div class="mH"
onclick="toggleMenu('menu2')">+ Dropdown</div>
<div id="menu2" class="mL">
<a class="mO" href="blmenu.htm">Introduction</a>
<a class="mO" href="blmenu1.htm">Head Script</a>
<a class="mO" href="blmenu2.htm">Customize</a>
<a class="mO" href="blmenu3.htm">Body Script</a>
</div>
</div>
<body>
</html>
Comment