I have a simple ASP.Net form with the following unordered list:
<ul id="ctl00_ContentPlaceHolder1_BulletedList1">
<li>No Lines Added</li>
</ul>
When a user begins filling out other parts of the form, I want to remove this single <LI>
and begin populating the list with other <LI>
elements. The code below is how I am doing the removal:
function commitLine() {
//if "No Lines Added" is the only item, remove all items, otherwise
//continue with the additional item
if ($("#ctl00_ContentPlaceHolder1_BulletedList1 li:nth-child(1)").text() == "No Lines Added") {
$("#ctl00_ContentPlaceHolder1_BulletedList1 li").remove();
}
//code that begins the list population
}
Now, this code works great in every browser except IE8 (presumably IE7, IE6 as well). I've been staring at this for hours and can't sort it out. Does anyone have an idea as to the problem here?