Scenario:
I have a page with various categories, all hidden by <div>'s with a class of 'displayNone'. I have a drop-down selection box where when the user clicks on an option, the class of a specific <div> will change to 'displayBlock'.
My javascipipt is:
<script language="javascript">
function display_contractors(element) {
if (element) {
general_contractor.className = 'displayNone';
sub_contractor.className = 'displayNone';
carpentry.className = 'displayNone';
element.className = 'displayBlock';
}
}
</script>
element.className refuses to work. :(
If I change one of the first three to displayBlock, that category works.
If I do an "alert(element)" right before element.className, I get the appropriate element, so I know it is being passed.
What am I missing to make element.className = 'displayBlock' work?
Thanks in advance for your help.
I have a page with various categories, all hidden by <div>'s with a class of 'displayNone'. I have a drop-down selection box where when the user clicks on an option, the class of a specific <div> will change to 'displayBlock'.
My javascipipt is:
Code:
<script language="javascript">
function display_contractors(element) {
if (element) {
general_contractor.className = 'displayNone';
sub_contractor.className = 'displayNone';
carpentry.className = 'displayNone';
element.className = 'displayBlock';
}
}
</script>
element.className refuses to work. :(
If I change one of the first three to displayBlock, that category works.
If I do an "alert(element)" right before element.className, I get the appropriate element, so I know it is being passed.
What am I missing to make element.className = 'displayBlock' work?
Thanks in advance for your help.