I'm trying to create a submenu with js. but it doesnt work. I want to click the education(in a tag) so the ul(with class named sub) opens and shows the submenu.
here is the code:
<script language="javascript" type="text/javascript">
function open()
{
var e = document.getElementById(sub);
if(e.style.display == 'block'){
e.style.display = 'none';
}
else{
e.style.display = 'block';
}
}
</script>
<div id="submenu">
<ul>
<li class="headersub"><a href="" class="blue" onClick="open()">education</a>
<ul class="sub" style="display:none;">
<li>
<?php if(isset($_SESSION['user']))require('./module/adminmenu/adminmenu.php'); ?>
</li>
</ul>
</li>