-1
<script type="text/javascript" >
$(document).ready(function()
{
$(".comment").click(function(){
var element = $(this);
var id = element.attr("post_id");
$("#"+id).html('<form action="test.php" method="post"><textarea name="body" id="body_'+id+'"></textarea></form>');
$("#body_"+id).focus();
return false;
});
});
<a href="#" post_id="17" class="comment">Open</a>
<div id="17"></div>
爲什麼每次當我在textarea的輸入內容,然後點擊的.comment鏈接時,textarea的值變爲空白鍵入,我應該如何保持什麼我鍵入不會被刪除?
太棒了....謝謝 –