有一个奇怪的情况发生.我有一个< h3>里面有文字.当我用.text()提取此文本,然后将其放入< textarea>该文本出现两次.
HTML
<h3 class="profileRightAboutMeText">heya,this is all the text.</h3> <textarea class="profileRightAboutMeTextarea"></textarea>
JQUERY
$(document).on('click','h6.editMyProfileSection',function() { var originalText = $('h3.profileRightAboutMeText').text(); $('h3.profileRightAboutMeText').fadeOut('fast',function() { $('textarea.profileRightAboutMeTextarea').text(originalText).fadeIn('fast'); }); alert(originalText); });