Could someone look at this and see what I am doing wrong, or is there and easier way to do this.
function degreeSelect() {
var selectedValue = document.getElementById("selDegree").value;
document.getElementsByClass("acadDegree_list").style = "display: none";
document.getElementsByClass("busDegree_list").style = "display: none";
document.getElementsByClass("carDegree_list").style = "display: none";
if(selectedValue == "Academic_Degree")
document.getElementsByClass("acadDegree_list").style = "display: block";
if(selectedValue == "Business_Degree")
document.getElementsByClass("busDegree_list").style = "display: block";
if(selectedValue == "Career_Certificate")
document.getElementsByClass("carDegree_list").style = "display: block";
}
<div class="div_hide_class"><label class="cf_label"
style="width: 150px;">What is
your Major?</label>
<select class="div_hide_class" id="selDegree" onchange="degreeSelect();" size="1" title=""
name="selDegree">
<option value="">Choose
Option</option>
<option value="Academic_Degree">Academic Degree</option>
<option value="Business_Degree">Business Degree</option>
<option value="Career_Certificate">Career Certificate</option>
</select>
<a class="tooltiplink" onclick="return false;"><img class="tooltipimg"
alt="" src="components/com_chronocontact/css/images/tooltip.png"
border="0" height="16" width="16"></a>
<div class="tooltipdiv">What
is your Major? :: You will be able to discuss this choice during
advisement .</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="acadDegree_list" style="display: none;">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Academic Degrees</label>
<select class="cf_inputbox" id="select_54" size="1" title="" name="acadDegreeOpt" >
<option value="">Choose Option</option>
<option value="00205 Accountancy">00205 Accountancy</option>
<option value="00120 Animal Science">00120 Animal Science</option>
<option value="00405 Art">00405 Art</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="busDegree_list" style="display: none;">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Business Degrees</label>
<select class="cf_inputbox" id="select_55" size="1" title="" name="busDegreeOpt">
<option value="">Choose Option</option>
<option value="06005 Accounting Technology">06005 Accounting Technology</option>
<option value="06022 Ag Bus & Mgmt Tech/Animal Husb">06022 Ag Bus & Mgmt Tech/Animal Husb</option>
<option value="06010 Agricultural Technology">06010 Agricultural Technology</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="carDegree_list" style="display: none;">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Career Techinal</label>
<select class="cf_inputbox" id="select_56" size="1" title="" name="carDegreeOpt">
<option value="">Choose Option</option>
<option value="08014 Automotive Technology">08014 Automotive Technology</option>
<option value="06031 Civil Technology">06031 Civil Technology</option>
<option value="08005 Collision Repair Technology">08005 Collision Repair Technology</option>
</select>
function degreeSelect() {
var selectedValue = document.getElementById("selDegree").value;
document.getElementsByClass("acadDegree_list").style = "display: none";
document.getElementsByClass("busDegree_list").style = "display: none";
document.getElementsByClass("carDegree_list").style = "display: none";
if(selectedValue == "Academic_Degree")
document.getElementsByClass("acadDegree_list").style = "display: block";
if(selectedValue == "Business_Degree")
document.getElementsByClass("busDegree_list").style = "display: block";
if(selectedValue == "Career_Certificate")
document.getElementsByClass("carDegree_list").style = "display: block";
}
<div class="div_hide_class"><label class="cf_label"
style="width: 150px;">What is
your Major?</label>
<select class="div_hide_class" id="selDegree" onchange="degreeSelect();" size="1" title=""
name="selDegree">
<option value="">Choose
Option</option>
<option value="Academic_Degree">Academic Degree</option>
<option value="Business_Degree">Business Degree</option>
<option value="Career_Certificate">Career Certificate</option>
</select>
<a class="tooltiplink" onclick="return false;"><img class="tooltipimg"
alt="" src="components/com_chronocontact/css/images/tooltip.png"
border="0" height="16" width="16"></a>
<div class="tooltipdiv">What
is your Major? :: You will be able to discuss this choice during
advisement .</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="acadDegree_list" style="display: none;">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Academic Degrees</label>
<select class="cf_inputbox" id="select_54" size="1" title="" name="acadDegreeOpt" >
<option value="">Choose Option</option>
<option value="00205 Accountancy">00205 Accountancy</option>
<option value="00120 Animal Science">00120 Animal Science</option>
<option value="00405 Art">00405 Art</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="busDegree_list" style="display: none;">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Business Degrees</label>
<select class="cf_inputbox" id="select_55" size="1" title="" name="busDegreeOpt">
<option value="">Choose Option</option>
<option value="06005 Accounting Technology">06005 Accounting Technology</option>
<option value="06022 Ag Bus & Mgmt Tech/Animal Husb">06022 Ag Bus & Mgmt Tech/Animal Husb</option>
<option value="06010 Agricultural Technology">06010 Agricultural Technology</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="carDegree_list" style="display: none;">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Career Techinal</label>
<select class="cf_inputbox" id="select_56" size="1" title="" name="carDegreeOpt">
<option value="">Choose Option</option>
<option value="08014 Automotive Technology">08014 Automotive Technology</option>
<option value="06031 Civil Technology">06031 Civil Technology</option>
<option value="08005 Collision Repair Technology">08005 Collision Repair Technology</option>
</select>