Note that there are some explanatory texts on larger screens.

plurals
  1. PODelete unclosed tag elements via jQuery
    text
    copied!<p>Say I have element sequence like below :</p> <pre><code>&lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;Something Here&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt; </code></pre> <p>There are unclosed elements below and I want to delete them because they ruin the design layout. So could please tell me how to find and delete the unclosed and empty elements like above :</p> <pre><code>&lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt; </code></pre> <p>Your help is much appreciated.</p> <p><strong>Edit for Recommendations :</strong> First of all, editing source code is something really impossible. Because they are hundred of pages like this one and I need a quick solution :( I didn't write those codes but I have to maintain right now and I need temporary but working solutions.They are static so I can't use server side code at this point because they are all html files.</p> <p><strong>Edit For Recommendation 2 :</strong> The structure actually is same. </p> <p><strong>Corrupted HTML :</strong></p> <pre><code>&lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;Something Here&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;Something Here&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt; </code></pre> <p><strong>How it is supposed to be :</strong></p> <pre><code>&lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;Something Here&lt;/div&gt; &lt;div style="margin-bottom:9px;line-height:normal;margin-top:4px"&gt;Something Here&lt;/div&gt; </code></pre> <p>There is no inner divs or anything else, it is pretty straightforward.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload