How to extract a value inside href= and title and description values from hyperlinkable image divs in javascript?
<p>I got an HTML string as (var code); I want to extract all values of sid=(example:12345) inside href and title(example: Star Album) and episode number (example:episode 4) but i am wondering how I can do that in JavaScript and have all sid, title and episode number values in array so i can construct hyperlinks ?</p>

<p>Note: initial value of $code is blocks of div like example below:</p>

<pre><code>&lt;td width=120 valign="top"&gt;                     &lt;div style="height:135px;
    border:1px solid #BBBBBB; background:#BBBBBB; margin-left:2px;
    text-align:center; "&gt;
                    &lt;a href="/now/episodes.php?name=path&amp;id=4000&amp;sid=12345&amp;page=0"&gt;&lt;img
    border="0" src="http://www.somesite.com/1234.jpg" width="150"
    height="83"&gt;&lt;/a&gt;&lt;br&gt;
                        &lt;font face="Tahoma" size="2"&gt;&lt;b&gt;Star Album&lt;/b&gt;&lt;br/&gt;
                            episode 4
                        &lt;/font&gt;             &lt;/div&gt;


        &lt;/td&gt;
</code></pre>
