jQuery: Selecting the text when p contains a listpoint
<p>I've got some comments in a guestbook. p containins '(In [ 'sometimes. The '(In [' sometimes contains a list.</p>

<pre><code> &lt;div class=&quot;comment searchable&quot;&gt;
 &lt;p&gt;
(In &lt;a class=&quot;changeset&quot; href=&quot;/../&quot; sets mynumber&quot;&gt;[Phonebook]&lt;/a&gt;)
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;tt&gt;Name&lt;/tt&gt;, &lt;tt&gt;Number&lt;/tt&gt; 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;is &lt;a class=&quot;is new entry&quot; href=&quot;/../mynumber&quot;&gt;new entry&lt;/a&gt;
&lt;/p&gt;
 &lt;/div&gt; </code></pre>

<p>This is how I get all '(In' 's and some text in the same line. I insert them in a 'box' after a div.</p>

<pre><code>    $(&quot;&lt;div id='createDiv' style='border:1px outset #999966;padding:1em;margin-top:1em'&gt;&lt;/div&gt;&quot;).insertAfter(&quot;#changelog&quot;);
    $(&quot;#createDiv&quot;).append($(&quot;p:contains('In [')&quot;).clone()); </code></pre>

<p>But how do I select and insert the whole text when the comments also contains a listpoint?</p>

<p>I'm using jQapi as a reference which is very useful. I was looking for sth like:
p:contains('li'). </p>

<p>Thank you in advance for any hint.</p>

<p><strong>Edit:</strong> What should come out:</p>

<p>(In [Phonebook])  Name, Number is new entry.</p>

<p>Now it is:
(In [Phonebook])</p>
