<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <link>http://persumi.com/u/fredwu/tech/e/blog/t/parse</link>
    <generator>Persumi - Level up your writing and blogging with AI</generator>
    <category>Blog</category>
    <category>Tech</category>
    <pubDate>Fri, 01 May 2026 20:14:32 +0000</pubDate>
    <description/>
    <title>Blog (parse) - Fred Wu&apos;s Tech</title>
    <atom:link type="application/rss+xml" rel="self" href="http://persumi.com/u/fredwu/tech/e/blog/t/parse/feed/rss"></atom:link>
    <item>
      <pubDate>Wed, 28 Apr 2010 01:42:00 +0000</pubDate>
      <guid>http://persumi.com/u/fredwu/tech/e/blog/p/jquery-tip-traverse-parse-html-string</guid>
      <comments>http://persumi.com/u/fredwu/tech/e/blog/p/jquery-tip-traverse-parse-html-string</comments>
      <category>Blog</category>
      <category>Tech</category>
      <author>ifredwu@gmail.com (Fred Wu)</author>
      <description>&lt;![CDATA[&lt;p&gt;
When you are getting an HTML string from an external source (e.g. from an AJAX get result) and you want to rip out a certain part of the HTML source, you need to make sure that the ‘certain part’ is not at the top level of the HTML source.&lt;/p&gt;
&lt;p&gt;
For example, we have the following HTML string:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Hello
World&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
If we want to get the first &lt;code class=&quot;inline&quot;&gt;paragraph&lt;/code&gt; element by using:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;js language-js&quot;&gt;// data is the HTML source
$(&apos;span#first&apos;, data)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
The above code won’t work, because the &lt;code class=&quot;inline&quot;&gt;p&lt;/code&gt; tags are at the top level. Instead, we can simply wrap the HTML source with a &lt;code class=&quot;inline&quot;&gt;div&lt;/code&gt; tag and that’ll do it. :)&lt;/p&gt;
]]&gt;</description>
      <link>http://persumi.com/u/fredwu/tech/e/blog/p/jquery-tip-traverse-parse-html-string</link>
      <title>[jQuery Tip] Traverse/Parse HTML String</title>
    </item>
  </channel>
</rss>