Home > Backend Development > PHP Tutorial > 评论时点 “回复” 把当前内容要回复的内容添冲到textarea里,并在句首得到光标解决方法

评论时点 “回复” 把当前内容要回复的内容添冲到textarea里,并在句首得到光标解决方法

WBOY
Release: 2016-06-13 10:26:04
Original
1078 people have browsed it

评论时点 “回复” 把当前内容要回复的内容添冲到textarea里,并在句首得到光标
就像个连接一样
http://v.youku.com/v_show/id_XNDAwODQ0OTY4.html
内容添冲到ftextarea里,我会,但是要在添冲文字后,句首得到光标我不会。

$('#comment').focus();

这样得到的是句尾得到的。

------解决方案--------------------

PHP code
insertAdjacentText 在指定位置插入给定的文本。 Syntaxobject.insertAdjacentText(sWhere, sText)ParameterssWhere Required. String that specifies where to insert the text, using one of the following values: beforeBegin Inserts the text immediately before the element. afterBegin Inserts the text after the start of the element but before all other content in the element. beforeEnd Inserts the text immediately before the end of the element but after all other content in the element. afterEnd Inserts the text immediately after the end of the element.  sText Required. String that specifies the text to insert. 手册上的。。<br><font color="#e78608">------解决方案--------------------</font><br>参考帖子 http://topic.csdn.net/u/20120329/09/e12eb48a-aa5f-4f99-84de-189b34f9e285.html<br>#7 的回复。<br><font color="#e78608">------解决方案--------------------</font><br><a href="#" onclick="VideoComments.reply(373323281,'4fbce32ef0b7e2a929000000','4fbce32ef0b7e2a929000000',false);return false;">回复</a><br><br>把id传进去,不也可以?<br><br><div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template