Tar*_*rik 1 html javascript jquery
说我有如下元素序列:
<div style="margin-bottom:9px;line-height:normal;margin-top:4px"></div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">Something Here</div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">
Run Code Online (Sandbox Code Playgroud)
下面有未公开的元素,我想删除它们,因为它们破坏了设计布局.那么请告诉我如何查找和删除上面未封闭和空的元素:
<div style="margin-bottom:9px;line-height:normal;margin-top:4px"></div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助.
编辑推荐:首先,编辑源代码是不可能的.因为它们是像这样的百页,我需要一个快速的解决方案:(我没有写那些代码,但我现在必须维护,我需要临时但工作的解决方案.他们是静态的所以我不能使用服务器端此时的代码因为它们都是html文件.
编辑建议2: 结构实际上是相同的.
HTML损坏:
<div style="margin-bottom:9px;line-height:normal;margin-top:4px"></div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">Something Here</div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">
<div style="margin-bottom:9px;line-height:normal;margin-top:4px"></div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">Something Here</div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">
Run Code Online (Sandbox Code Playgroud)
它应该如何:
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">Something Here</div>
<div style="margin-bottom:9px;line-height:normal;margin-top:4px">Something Here</div>
Run Code Online (Sandbox Code Playgroud)
没有内在的div或其他任何东西,它非常简单.
| 归档时间: |
|
| 查看次数: |
2375 次 |
| 最近记录: |