jquery
<div class="block_comments"> <div class="comment"> <div class="userpic"><a href="#"><img src="/static/imghwm/default1.png" data-src="images/ava_default_1.jpg" class="lazy" alt="" /></a></div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为人们要感恩的人哟很多法撒旦法涉及多方考虑斯达康减肥就算了打开解放累进税率大幅速卡戴假发就算了打开房间速率可达飞机螺丝钉棵发了看似简单</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth"></div> <div class="line_3"></div> </div> <div class="comment"> <div class="userpic"><a href="#"><img src="/static/imghwm/default1.png" data-src="images/ava_default_1.jpg" class="lazy" alt="" /></a></div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为人们要感恩的人哟很多法撒旦法涉及多方考虑斯达康减肥就算了打开解放累进税率大幅速卡戴假发就算了打开房间速率可达飞机螺丝钉棵发了看似简单</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth"></div> <div class="line_3"></div> </div> <div class="comment"> <div class="userpic"><a href="#"><img src="/static/imghwm/default1.png" data-src="images/ava_default_1.jpg" class="lazy" alt="" /></a></div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为人们要感恩的人哟很多法撒旦法涉及多方考虑斯达康减肥就算了打开解放累进税率大幅速卡戴假发就算了打开房间速率可达飞机螺丝钉棵发了看似简单</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth"></div> <div class="line_3"></div> </div> </div>
1,点击回复后在那里加一个div,在点击这个回复时这个div移除,
2,点其中一个回复后再点击其两个回复时,只能有一个div,其他的移除,
3,也就是说不管点哪个,只能有一个新div出现
回复讨论(解决方案)
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /><script type = "text/javascript" src = "js/jquery.js"></script><title>无标题文档</title><style type = "text/css"></style></head><script>$(function(){ $(".control").click(function(){ $("div.insertDiv").remove(); $(this).parents().next(".clearboth").before("<div class= 'insertDiv'>charuchenggong</div>"); return false; });});</script><body><div> <div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <div class="clearboth">sdf</div> <div class="line_3">sd</div> </div> <div class="comment"> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为</p> <p class="info"><a href="#none" class="control" id="rep1" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth">435</div> <div class="line_3">345</div> </div></div></body></html>
把那段加上,就可以了,同时,在同一个页面,不要用相同的id,如果你需要那一组用同样的操作,可以用class,id相同等于把id这个属性废了。

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver CS6
Visual web development tools