Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery: list appended not displaying bullets
    primarykey
    data
    text
    <p>I have the following html:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;span&gt;not so important&lt;/span&gt; &lt;span title="some specific text"&gt;&lt;img src="/img/some.gif" /&gt;&lt;/span&gt; &lt;span title="more specific text"&gt;important 1&lt;/span&gt; &lt;span title="more specific text"&gt;important 2&lt;/span&gt; &lt;span title="more specific text"&gt;important 3&lt;/span&gt; &lt;span title="more specific text"&gt;&lt;img src="/img/some.gif" /&gt;&lt;/span&gt; &lt;ul&gt; &lt;li&gt;example 1&lt;/li&gt; &lt;li&gt;example 2&lt;/li&gt; &lt;li&gt;example 3&lt;/li&gt; &lt;ul&gt; &lt;script&gt; var ul = $('body').append($('&lt;ul&gt;')); $("span[title*='specific text']") .contents() .filter(function(){ return $(this).nodeType != 1; }) .each(function(){ ul.append($('&lt;li&gt;' + $(this).text() + '&lt;/li&gt;')); }) &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I want to retrieve the text within a 'span' whose title attribute contains "specific text", in this case "important 1", "important 2" and "important 3". Then I want to list them below just like the example. However the bullets do not appear, why is that? Any hints would be appreciated!</p> <p><strong>EDIT:</strong> <a href="http://jsfiddle.net/XTqjC/3/" rel="nofollow noreferrer">http://jsfiddle.net/XTqjC/3/</a> this is the code that does what I need it to do. Thanks to Glen and meo</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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