日期:2014-05-16  浏览次数:20471 次

js 删除某个元素下的ul标记

现在做一个ajax动态树形目录,当点击一本书的时候发送ajax请求,从服务器返回图书的一级目录,将放回的数据绑定到本书的<li>标记下边。
现在有个问题,当一本书点击多次时该书的目录则会被绑定多次,现在想将li ID为200804010001 下的<ul>标记中的内容删除掉,也包括<ul>标记。
请问哪位高手能指点一二。

代码如下
HTML code


<li id="200804010001" class="Opened"><img class="s" onclick="ExCls(this,'Opened','Closed',1,'200804010001');" src="css/s.gif"><a id="link_200804010001" onclick="ExCls(this,'Opened','Closed',1,'200804010001');" style="cursor:pointer;">山东年鉴1987</a>
<ul><li id="200804010001_126779" class="Child"><img class="s" src="css/s.gif"><a id="link_200804010001_126779" style="cursor:pointer;" onclick="document.getElementById('content_iframe').src='content_iframe.aspx?bookid=200804010001&amp;contentid=126779&amp;type=d&amp;show=content' ">编纂委员</a></li>
<li id="200804010001_126780" class="Child"><img class="s" src="css/s.gif"><a id="link_200804010001_126780" style="cursor:pointer;" onclick="document.getElementById('content_iframe').src='content_iframe.aspx?bookid=200804010001&amp;contentid=126780&amp;type=d&amp;show=content' ">编辑说明</a></li>
<li id="200804010001_126781" class="Child"><img class="s" src="css/s.gif"><a id="link_200804010001_126781" style="cursor:pointer;" onclick="document.getElementById('content_iframe').src='content_iframe.aspx?bookid=200804010001&amp;contentid=126781&amp;type=d&amp;show=content' ">序</a></li>
<li id="200804010001_126782" class="Child"><img class="s" src="css/s.gif"><a id="link_200804010001_126782" style="cursor:pointer;" onclick="document.getElementById('content_iframe').src='content_iframe.aspx?bookid=200804010001&amp;contentid=126782&amp;type=d&amp;show=content' ">转发省地方史志编纂委员会《关于编辑出版〈山东年鉴〉报告》的通知</a></li>
<li id="200804010001_126783" class="Closed"><img class="s" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126783');" src="css/s.gif"><a id="link_200804010001_126783" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126783');" style="cursor:pointer;">大事记</a>
</li><li id="200804010001_126784" class="Closed"><img class="s" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126784');" src="css/s.gif"><a id="link_200804010001_126784" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126784');" style="cursor:pointer;">概况</a>
</li><li id="200804010001_126789" class="Closed"><img class="s" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126789');" src="css/s.gif"><a id="link_200804010001_126789" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126789');" style="cursor:pointer;">政治</a>
</li><li id="200804010001_126810" class="Closed"><img class="s" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126810');" src="css/s.gif"><a id="link_200804010001_126810" onclick="ExCls(this,'Opened','Closed',1,'200804010001_126810');" style="cursor:pointer;">军事</a>
</li><li id="200804010001_126815" class="Closed"><img cl