Ik wil graag het volgende: Als je op een link klikt moet overal waar class="on" gebruikt wordt class="off" komen te staan en vervolgens moet de class van de betreffende link op "on" gezet worden.
Dit is wat ik heb, maar dat schijnt niet te werken.
Kan iemand mij helpen?
<HTML>
<HEAD>
<TITLE>Links</TITLE>
<STYLE>
.on { font-size: 16; text-decoration: underline; color: blue; }
.off { font-size: 16; text-decoration: none; color: black; }
</STYLE>
<SCRIPT language=JavaScript>
<!--
function doSection() {
if (className == "on") {
className = "off";
}
}
function doSectionOpen(secNum){
secNum.className="on"
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<A HREF ="#" class="on" ID="Sec1" onClick="doSection();" "doSectionOpen(Sec1);">Programmers</A><P>
<A HREF ="#" class="off" ID="Sec2" onClick="doSection();" "doSectionOpen(Sec2);">Designers</A><P>
<A HREF ="#" class="off" ID="Sec3" onClick="doSection();" "doSectionOpen(Sec3);">Managers</A><P>
</BODY>
</HTML>
Dit is wat ik heb, maar dat schijnt niet te werken.
Kan iemand mij helpen?
<HTML>
<HEAD>
<TITLE>Links</TITLE>
<STYLE>
.on { font-size: 16; text-decoration: underline; color: blue; }
.off { font-size: 16; text-decoration: none; color: black; }
</STYLE>
<SCRIPT language=JavaScript>
<!--
function doSection() {
if (className == "on") {
className = "off";
}
}
function doSectionOpen(secNum){
secNum.className="on"
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<A HREF ="#" class="on" ID="Sec1" onClick="doSection();" "doSectionOpen(Sec1);">Programmers</A><P>
<A HREF ="#" class="off" ID="Sec2" onClick="doSection();" "doSectionOpen(Sec2);">Designers</A><P>
<A HREF ="#" class="off" ID="Sec3" onClick="doSection();" "doSectionOpen(Sec3);">Managers</A><P>
</BODY>
</HTML>