Populating div with textarea content
I am trying to populate a preview div with the content of a textarea. I have 2 textareas on the page. One with ID compose and another with ID profile_signature. Each has its own preview button named respectivly #profile_sig_preview and #msg_preview. however no matter which button is clicked the div is always populated with the content of the first textarea ie profile_signature. I tired setting up 2 divs so the content could be seperated but that did the same thing.
- $j('#preview_msg_btn').click(function(){
- $j('#preview').html($j('textarea#compose').val());
- alert($j('textarea#compose').val());
- alert($j('textarea#profile_signature').val());
- $j('#preview').css('display','block');
- $j('#preview').preview();
- });
as you can see iam alerting out both textareas html content and the alert shows the content fine. Just not the div. Anyone know why this is?