I have following code in cshtml page:
<ul id="menu">
<li><a href="..." >Link1</a></li>
<li><a href="..." >Link2</a></li>
</ul>
And I want to change class of a tag when some condition is true. I tried this, but it does not work:
<ul id="menu">
<li
<script> if (..condition..)
document.write(" class = \"newclass\"");
</script>
><a href="..." >Link1</a></li>
<li><a href="..." >Link2</a></li>
</ul>
Could you please suggest the way to do it?
Thanks, Zhenya
lielements under menu or a specificlielement? If a specific one, which element?document.writewrites to the output... and not to the markup itself!