怎么用js把网页里多余的<UL></UL>代码去掉!
发布网友
发布时间:2022-10-17 14:50
我来回答
共1个回答
热心网友
时间:2023-10-31 05:23
<div id=abc123>
<LI><A href="proct/?type=list&classid=6" target=_self>LED 柔性灯条</A>
<UL></UL>
<LI><A href="proct/?type=list&classid=7" target=_self>LED 硬灯条(铝槽)</A>
<UL></UL>
<LI><A href="proct/?type=list&classid=8" target=_self>LED 天花灯</A>
<UL></UL>
<LI><A href="proct/?type=list&classid=9" target=_self>LED 射灯</A>
<UL></UL>
</div>
<script type="text/javascript">
//这段js要写在DIV的后面
document.getElementById('abc123').innerHTML=document.getElementById('abc123').innerHTML.replace(/\<\u\l\>\<\/\u\l\>/g,"");
</script>