problem with .attr() method for getting value of attributes of elements
<p>i have a string like this :  </p>

<pre><code>string_data = "&lt;option value='1'&gt;ahmad&lt;/option&gt;&lt;option value='2'&gt;mohammad&lt;/option&gt;&lt;option value='3'&gt;ali&lt;/option&gt;"
</code></pre>

<p>now i want get the value of value attribute of options and alert it. for this i write this :  </p>

<pre><code>$(string_data).contents()
.each(function(){
    value   =   $(this).attr('value');
    text    =   $(this).text();
    alert(value);
});
</code></pre>

<p>but this code return <strong>undefined</strong> for all of them .<br>
in Addition <strong>string_data</strong> is a string that i get it from a php script with Ajax via $.post() jQuery method.<br>
i am using jquery 1.6 .</p>
