谢谢阅读。
我有评论列表,每条评论都有一个回复链接。当您单击链接时,应显示该个人评论的表单。
我很混乱。我写了这个 jquery,但我知道它甚至没有意义。
<script>
$('.reply-comment').click(function(){
var CommentID = $(this).attr('id');
$(this).hide();
$('.reply-comment-form').show( function(){
$('.reply-comment-form-'+CommentID).html();
});
return false;
});
</script>
这是表格
<div class="reply-comment-form well">';
<form name="reply-form" id="reply-form" method="POST">
<textarea name="Comment" rows="6" class="span10"></textarea> <br />
<input type="submit" class="btn btn-primary replycommentsubmitbutton" value="Yanitla" />
</form>
</div>
我在每个评论下添加了一个跨度以显示表单
<div>
comments text etc etc...
</div>
<a href="" class="reply-comment" id="<?php $v['CommentID'] ?>"> Reply </a>
<span id="reply-fomment-form-<?php $v['CommentsID'] ?>"></span>
那么,如何将 show() 函数与 html() 函数一起使用,或者还有其他方法吗?
请你帮助我好吗?谢谢。