I have blocks of divs that have anchor tags inside.
How can you extract the value of the property "sid" from the href property of each anchor tag?
the way i get my code data :
$.getJSON('http://anyorigin.com/get?url=http://www.somesite.com&callback=?', function(data){
        //$('#output').html(data.contents);
 var code = data.contents;
 document.myform.outputtext.value = code
I tried this but it doesn't output value of href ?
var pattern = /<a href="([^"]+?)">/gi;
code = code.match(pattern);
for (i = 0; i < code.length; i++) {
document.write(code[i].replace(pattern, '<a href="./doit.php?Id=$1&title=$2">$2</a><br />'));
}
example of code string:
<td width=120 valign="top">                     <div style="height:135px;
    border:1px solid #BBBBBB; background:#BBBBBB; margin-left:2px;
    text-align:center; ">
                    <a href="/now/episodes.php?name=path&id=4000&sid=12345&page=0"><img
    border="0" src="http://www.somesite.com/1234.jpg" width="150"
    height="83"></a><br>
                        <font face="Tahoma" size="2"><b>Star Album</b><br/>
                            episode 4
                        </font>             </div>
        </td>
 
     
    