Hello i have an html list:
[CODE]
<ul id=”carrierList”>
<li class=”carrierListElem” name=”AmeriHealth Administrators” value=”AmeriHealth Administrators”>AmeriHealth Administrators</li>
<li class=”carrierListElem” name=”Carefirst-Blue Cross Blue Shield” value=”Carefirst-Blue Cross Blue Shield”>Carefirst-Blue Cross Blue Shield</li>
<li class=”carrierListElem” name=”3P ADMIN” value=”3P ADMIN”>3P ADMIN</li>
</ul>
and i want to get either the value or name using javascript and based of the value/name change the style to display:none;
i currently am doing this:
[CODE]
carrierList = document.getElementById(“carrierList”);
// get all list elements of the carrier list
carriers = carrierList.getElementsByTagName(“li”);
alert(carriers[0].name);
alert(carriers[1].value);
however the alert message just says “undefined”
can anyone help me? i want to be able to get the contents of the li element into a string.