JS Implementation Click on the comment to display the reply box

Source: Internet
Author: User

Someone in the group asked how to click the Reply button in the comments, the following will automatically display a reply box, he wants the effect

So I randomly wrote a section of HTML, the code is as follows:

<!DOCTYPE HTML><HTMLLang= "en -us"><Head>    <MetaCharSet= "UTF-8">    <title></title>    <Scriptsrc= "Http://cdn.bootcss.com/jquery/2.2.4/jquery.js"></Script></Head><ul>    <Li>user reviews for No. 1th<Div>Hello, this is 1th comment 2018-03-21 12:00:00<ahref= "javascript:;"class= "Reply_btn" >Reply</a></Div>    </Li>    <Li>user reviews for No. 2nd<Div>Hello, this is 2nd comment 2018-03-21 12:00:00<ahref= "javascript:;"class= "Reply_btn" >Reply</a></Div>    </Li>    <Li>user Reviews for No. 3rd<Div>Hello, this is 3rd comment 2018-03-21 12:00:00<ahref= "javascript:;"class= "Reply_btn" >Reply</a></Div>    </Li></ul><Body>    <Scripttype= "Text/javascript">        $(function(){            //events that start when the page has finished loading            $(". Reply_btn"). Click (function(){                $(". Reply_textarea"). Remove (); $( This). Parent (). Append ("<div class= ' reply_textarea ' ><textarea name= ' cols= ' rows= ' 5 ' ></textarea><br/>< Input type= ' submit ' value= ' published '/></div>");        });    }); </Script></Body></HTML>

Effect

JS Implementation Click on the comment to display the reply box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.