How to separate data received from $.get() callback function
<p>I have this:</p>

<pre><code>&lt;div &gt;&lt;span id="compareResult"&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span id="result"&gt;&lt;/span&gt;&lt;/div&gt;


$.get(
      'data.php', 
      { valA: $(this,'option:selected').val() , valB:$(this,'option:selected').val()},
      function(childData){
            $('#result').html(childData).css('display', 'none')});&gt;
</code></pre>

<p>PHP:</p>

<pre><code>function getData($names,$id,$flag){
    if($flag==0){
    $strResult = '&lt;select multiple class="sel" id="selectname" size='.count($names).'&gt;';
    }
    if($flag==1){
    $strResult = '&lt;select multiple class="sel" id="selname" size='.count($names).'&gt;';
    }

    for($i=0; $i&lt;count($names); $i++)
    {
        $strResult.= '&lt;option value='.$id[$i].'&gt;'.$names[$i].'&lt;/option&gt;';
    }
    echo $strResult.= '&lt;/select&gt;';}
</code></pre>

<p>How do I break apart/parse the response  inside .html(childData) so I can put it in different span(i.e. id="compareResult")?</p>

<p>Thanks in advance.</p>
