|
Good morning everyone,
I have a <UL> Html, and i want set a Style class call "current" each time you click on each <il> item , but it does not work.
I'll show you the code used to try accomplish this task:
- JavaScript Function:
<script>
// <![CDATA[
function setClassName(objId, className) {
document.getElementById(objId).className = className;
}
// ]]>
</script>
Function implementation into my proyect:
<ul id="saturday">
<li><a href="index.aspx" onclick="setClassName(this,'current')"><span>Inici o</span></a></li>
<li><a href="Default.aspx" onclick="setClassName(this,'current')"><span>Conta cto</span></a></li>
<li><a href="index.aspx" onclick="setClassName(this,'current')"><span>Estan cias</span></a></li>
<li><a href="index.aspx" onclick="setClassName(this,'current')"><span>Info</span></a></li>
<li><a href="index.aspx" onclick="setClassName(this,'current')"><span>Unipa go</span></a></li>
<li></li>
</ul>
it does not works.
your comments would be helpfull.
|