如何在jquery中设置div动态控件? [英] How to set div dynamic control in jquery?

查看:95
本文介绍了如何在jquery中设置div动态控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



i急需帮助,



现在我有像A这样的div标签, B,C,d。内部有radio,textarea,dropdown,removelink(删除div),每个div标签。



如果点击按钮(addoption)我需要显示E Div所有控件,如果我再次点击按钮,需要显示所有控件的F Div,所以它将继续...直到Z Div。



i尝试准备很多网站,也很多jquery。但是效果不好。



请任何人与我分享您的建议和想法。我需要非常紧急。



谢谢:)

renga

Hi friends,

i need help urgent,

now i have div tags like A,B,C,D. inside have radio, textarea, dropdown,removelink(for remove div),for each div tag.

if click button(addoption) i need show E Div with all controls, if again i click the button, need to show F Div with all controls, so it will continued...until Z Div.

i try ready many websites, also many jquery. but its not working well.

kindly pls anyone share with me your suggestion and ideas. i need very urgent.

Thanks :)
renga

推荐答案

您好Renga.g,



以下是我使用您的html设计创建的示例: -



例如,我只使用了一个div,添加选项按钮可以添加更多带有下一个字母的div。



Hi Renga.g,

Here is a sample i have created using your html design :-

I have taken only one div for example and 'Add Option' button can add more divs with next letter.

<form id="form1" runat="server">
        <div id="Div_B">
            <div>B : <input onclick="javascript:noCheck_B();" name="answer" type="radio" id="Radio_B" style="display: table-cell;padding:0px;margin:0px; vertical-align:middle" />
            <div style="display: table-cell;padding:0px;margin:10px;vertical-align:middle" class="rich-text-wrapper"> <textarea class="input-xxlarge">Answer B
            </textarea></div></div><br />
            <div id="Facet_B">Facet:
            <select style="width:540px; margin-top:5px">
            <option value="1">Select Facet</option>
            <option value="2">01. The student determines distance ny adding two or more positions during the motion.</option>
            <option value="3">02. The student does not distinguish position and/or distance from speed.</option>
            <option value="4">03. The student views a position or speed graph as a map of the actual motion.</option>
            </select> 

            </div>
        </div>
        <input id="btnClone" type="button" value="Add Option" />
    </form>





这是添加新内容的Javascript代码div点击'添加选项'按钮。

Ex: -





Here is the Javascript code to add the new div on click of 'Add Option' button.
Ex :-


function (){
// 'btnClone'是克隆最后一个div的按钮


' < span class =code-string>#btnClone')。click( function (){
// 获取ID为div的所有div文件'Div _'
var allDivs =
('#btnClone').click(function () { // get all divs with id having text 'Div_' var allDivs =


这篇关于如何在jquery中设置div动态控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆