Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery | Remove li tags
    primarykey
    data
    text
    <p>I'm searching a solution to remove <code>&lt;li&gt;</code> tags filtered using javascript array.</p> <p>var mygroups=["1","8","3","4","5"]</p> <p>Example (input):</p> <pre><code>&lt;li&gt;&lt;div&gt;1 element. Bla bla bla&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;2 element. Bla bla bla. This is my &lt;span&gt;post&lt;/span&gt; into new group&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;3 element. Bla bla bla. Another one&lt;/li&gt; &lt;li&gt;&lt;div&gt;&lt;a href="/groups/viewgroup/1-first-group"&gt;First group&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;5 element. Bla bla bla. This is my &lt;span&gt;new post&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;6 element. &lt;img alt="groups.wall" class="newsfeed-icon" src="/assets/favicon/default.png"&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;7 element.&lt;/li&gt; &lt;li&gt;&lt;div&gt;&lt;a href="/groups/viewgroup/8-second-group"&gt;First group&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;&lt;a href="/groups/viewgroup/16-other-group"&gt;First group&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;&lt;a href="/groups/viewgroup/5-tttt-group"&gt;First group&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; </code></pre> <p>How to get this output (Remove all instances which do not contain mygroups):</p> <pre><code>&lt;li&gt;&lt;div&gt;&lt;a href="/groups/viewgroup/1-first-group"&gt;First group&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;&lt;a href="/groups/viewgroup/8-second-group"&gt;First group&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div&gt;&lt;a href="/groups/viewgroup/5-tttt-group"&gt;First group&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; </code></pre> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

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