Forum Moderators: open
I need to change the class in the code via onclick, the following is a basic idea of what I need but javascript does not seem to accept .class -- Any help really appreciated!
<SCRIPT>
function ChangeClass() {
var ClassName = document.getElementById("WhatClass")
ClassName.class="NEW_VALUE"
}
</SCRIPT>
<div ID="WhatClass" class="ORIGIONAL_VALUE">
<a onclick="ChangeClass();">TEST</a>
Kind Regards
Walker
THE Following works for anyone who needs it in the future:
<SCRIPT>
function ChangeClass() {
var NAME = document.getElementById("WhatClass")
NAME.className="NEW_VALUE"
}
</SCRIPT>
<div ID="WhatClass" class="ORIGIONAL_VALUE">
<a onclick="ChangeClass();">TEST</a>
Kind Regards
Walker