in my webpage the menu has a structure like this:
<nav id="menu">
<label for="tm" id="toggle-menu">Menù <span class="drop-icon">▾</span></label>
<input type="checkbox" id="tm">
<ul class="main-menu clearfix">
<li><a href="http://www.internalsite.lab/">Home</a></li>
<li><a href="#">Transfer
<span class="drop-icon">▾</span>
<label title="Toggle Drop-down" class="drop-icon" for="sm1">▾</label>
</a>
<input type="checkbox" id="sm1">
<ul class="sub-menu">
<li><a href="data.html">internal data</a></li>
<li><a href="data_ext.html">external data</a></li>
</ul>
</li>
<li class="imp"><a href="necessary.html">Necessary Data</a></li>
</ul>
</nav>
and a CSS like this:
#menu .main-menu {
display: block;
}
#menu li,
#toggle-menu,
#menu a {
position: relative;
display: block;
color: white;
text-transform: capitalize;
text-shadow: 1px 1px 0 rgba(0, 0, 0, .125);
}
#menu .main-menu li.imp{
display: none;
}
#menu .main-menu li{
background-color: #197dd1;
font-weight: bold;
}
I would like to change the display none of the #menu .main-menu li.imp into block if a certain condition occurs, for this reason i have a js code like this
<script "application/javascript">
var javaScriptVar = "<?php echo $value; ?>";
if( value== "true") { document.getElementsByClassName('imp').style.display = 'block';}
</script>
I'am sure that value is equal true, but it does not work.
Any idea? Thank you very much