Somehow I can’t pre-populate textarea with a data from a table based on a code below:
HTML:
<td id="1_desc" class="edit_desc"><div class="gallery clearfix"><a href="{url}" rel="wp-prettyPhoto" title="VIDEO TITLE HERE">View Commercial</a></div></td>
<textarea id="edit_form_desc" rows="7" cols="50"></textarea>
jQuery:
var desc = jQuery("#1_desc").html();
jQuery("#edit_form_desc").val(desc);
Example http://jsfiddle.net/RkmYJ/
When I have “hardcoded” variable ‘desc’ everything works fine.
Any clue?
Thanks
Looks like the browser is tossing the parent-less
<td>you’ve described above. Wrap it up in a table, and things seem to work much better:Updated fiddle here