问题描述
我正在开发具有两个级别的评论重播评论系统,我在如何显示和隐藏 div 方面遇到了问题 ..,因为它的 id 是不同的 ..,我尝试了一种方式:
I am developing comment systems with two level of replay to the comments and I have a problem with how to show and hide divs .., because it's id's are different .., I tried in a way with:
<button>replayl</button>
<span style="display:none;">
<form action='' method='post' name="addcmt" onsubmit="return validate()">
<textarea rows="1" cols="60" name='textarea1' id='textarea1' onKeyDown="limitText(this.form.textarea1,this.form.countdown,300);"
onKeyUp="limitText(this.form.textarea1,this.form.countdown,300);">
</textarea>
<br>
<br>
<input type="hidden" name="level1" id="level1" value="commtlevel1" />
<input id='addcmt' type='submit' value='Add reply' name='submit'/>
</form>
</span>
和jquery:
<script>
$("button").click(function () {
$("span").show();
});
</script>
但是这样当我点击回复按钮时,它会显示所有的 span 标签内容......,我想知道我如何只显示一个标签或一种完成工作的方式.
but this way when I click reply button it shows all the span tag contente.., I wanna kow how I show one tag only or a way to my work done.
推荐答案
编辑后的问题,我建议你使用 div 而不是 span (因为 display inline vs block).
After edited question, i suggest you use div instead of span (because of display inline vs block).
$("button").click(function () {
$(".myform").toggle('slow');
});
可以按照您的意愿完成工作.这是结果.
would do the job how you want.Here is the result.
这篇关于动态创建 div 时如何显示/隐藏 div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)