克隆并使用jQuery插入div onclick

时间:2015-07-09 23:08:27

标签: jquery button onclick clone

出于某种原因,我无法使用onclick按钮获取克隆并插入div,请参阅下面的代码提取。我基本上想要克隆issueDiv,并在单击addButton时插入issueDiv1之后。

jQuery的:

$(document).ready(function() {

        $('#addbutton').click(function(){
        $('#issueDiv').clone().insertAfter('#issueDiv1');
        });
    });

的div:

 <div id="issueDiv">
   <div id="issueDiv1">
      <fieldset id="yourIssue">
         <legend>Request Details</legend>
         <p>Please choose what your issue(s) is below. (Please note if you have multiple balances out you will need to submit each one separately)</p>
         <p>
            <label>Your Request:</label>
            <select type="text" class="required" name="request_details" id="request_details" onchange="setspecificDetails(this);">
               <option value="">Select...</option>
               <option value="Trust Balance out">Trust Balance out</option>
               <option value="Bank Balance out">Bank Balance out</option>
               <option value="Tixc out">Tixc out</option>
               <option value="Ins out">Ins out</option>
               <option value="3rd Party out">3rd Party out</option>
               <option value="Comm out">Comm out</option>
               <option value="Tax out">Tax out</option>
               <option value="Other">Other</option>
            </select>
         </p>
      </fieldset>
      <div id="trustBalance" class="greyBox">
         <p><label>Date this balance went out according to the NBS auto-validation history search in Sherlock?</label><input type="text" class="required date-picker tinyInput" id="date_trust_balance_out" name="date_trust_balance_out"/> *</p>
         <br />
         <br />
         <p><label>Did an amount search bring back any further details that reate to the issue?</label></p>
         <textarea id="trust_amount_search" name="trust_amount_search" class="required" cols="90" rows="1" class="required"></textArea>
         *
         <br />
         <br />
         <p><label>Did the closed ledgers with non-zero balances search in Sherlock bring back any further information,</label></p>
         <p><label> if so please provide details below or attach screenhot:</label></p>
         <textarea id="trust_closedledgers_search" name="trust_closedledgers_search" class="required" cols="90" rows="1" class="required"></textArea>
         *
         <br />
         <br />
         <p><label>Please prodive any further details that might be relevant to the issue:</label></p>
         <textarea id="trust_further_details" name="trust_further_details" class="required" cols="90" rows="1" class="required"></textArea>
         *
      </div>
      <div id="bankBalance" class="greyBox">
         <p><label>Date this balance went out according to the NBS auto-validation history search in Sherlock?</label><input type="text" class="required date-picker tinyInput" id="date_bank_balance_out" name="date_bank_balance_out"/> *</p>
         <br />
         <br />
         <p><label>Did an amount search bring back any further details that reate to the issue?</label></p>
         <textarea id="bank_amount_search" name="bank_amount_search" class="required" cols="90" rows="1" class="required"></textArea>
         *
         <br />
         <br />
         <p><label>Did the compare bank rec history against statement search in Sherlock bring back any infomation?</label></p>
         <p><label>Please provide details below or attach screenshot.</label></p>
         <textarea id="compare_bank_search" name="compare_bank_search" class="required" cols="90" rows="1" class="required"></textArea>
         *
         <br />
         <br />
         <p><label>Please prodive any further details that might be relevant to the issue:</label></p>
         <textarea id="bank_further_details" name="bank_further_details" class="required" cols="90" rows="1" class="required"></textArea>
         *
      </div>
      <div id="tixcOut" class="greyBox">
         <p><label>(Please make sure you have carried out an amount search to provide further details on the issue)</label></p>
         <br />
         <br />
         <p><label>Date this balance went out according to the NBS auto-validation history search in Sherlock?</label><input type="text" class="required date-picker tinyInput" id="date_tixc_out" name="date_tixc_out"/> *</p>
         <br />
         <br />
         <p><label>Did the statements and payments search in Sherlock bring back any further details that relate to the issue?</label></p>
         <p><label> Please provide details below or attach screenshot:</label>
         <p>
            <textarea id="tixc_search" name="tixc_search" class="required" cols="90" rows="1" class="required">
            </textArea> *
            <br />
            <br />
         <p><label>Please prodive any further details that might be relevant to the issue:</label></p>
         <textarea id="tixc_further_details" name="tixc_further_details" class="required" cols="90" rows="1" class="required"></textArea>
         *
      </div>
      <div id="insOut" class="greyBox">
         <p><label>(Please make sure you have carried out an amount search to provide further details on the issue)</label></p>
         <br />
         <br />
         <p><label>Date this balance went out according to the NBS auto-validation history search in Sherlock?</label><input type="text" class="required date-picker tinyInput" id="date_ins_out" name="date_ins_out"/> *</p>
         <br />
         <br />
         <p><label>Did the statements and payments search in Sherlock bring back any further details that relate to the issue?</label></p>
         <p><label> Please provide details below or attach screenshot:</label>
         <p>
            <textarea id="insOut_search" name="insOut_search" class="required" cols="90" rows="1" class="required">
            </textArea> *
            <br />
            <br />
         <p><label>Please prodive any further details that might be relevant to the issue:</label></p>
         <textarea id="insOut_further_details" name="insOut_further_details" class="required" cols="90" rows="1" class="required"></textArea>
         *
      </div>
      <div id="3rdParty" class="greyBox">
         <p><label>(Please make sure you have carried out an amount search to provide further details on the issue)</label></p>
         <br />
         <br />
         <p><label>Date this balance went out according to the NBS auto-validation history search in Sherlock?</label><input type="text" class="required date-picker tinyInput" id="date_3rdparty_out" name="date_3rdparty_out"/> *</p>
         <br />
         <br />
         <p><label>Did the fin unbalances 3P types search in Sherlock bring back any further details that relate to the issue?</label></p>
         <p><label> Please provide details below or attach screenshot:</label>
         <p>
            <textarea id="3rdparty_search" name="3rdparty_search" class="required" cols="90" rows="1" class="required">
            </textArea> *
            <br />
            <br />
         <p><label>Please prodive any further details that might be relevant to the issue:</label></p>
         <textarea id="3rdparty_further_details" name="3rdparty_further_details" class="required" cols="90" rows="1" class="required"></textArea>
         *
      </div>
      <div id="commOut" class="greyBox">
         <p><label>(Please make sure you have carried out an amount search to provide further details on the issue)</label></p>
         <br />
         <br />
         <p><label>Date this balance went out according to the NBS auto-validation history search in Sherlock?</label><input type="text" class="required date-picker tinyInput" id="date_comm_out" name="date_comm_out"/> *</p>
         <br />
         <br />
         <p><label>Did the statements and payments search in Sherlock bring back any further details that relate to the issue?</label></p>
         <p><label> Please provide details below or attach screenshot:</label>
         <p>
            <textarea id="commOut_search" name="commOut_search" class="required" cols="90" rows="1" class="required">
            </textArea> *
            <br />
            <br />
         <p><label>Please prodive any further details that might be relevant to the issue:</label></p>
         <textarea id="commOut_further_details" name="commOut_further_details" class="required" cols="90" rows="1" class="required"></textArea>
         *
      </div>
      <div id="taxOut" class="greyBox">
         <p><label>(Please make sure you have carried out an amount search to provide further details on the issue)</label></p>
         <br />
         <br />
         <p><label>Date this balance went out according to the NBS auto-validation history search in Sherlock?</label><input type="text" class="required date-picker tinyInput" id="date_tax_out" name="date_tax_out"/> *</p>
         <br />
         <br />
         <p><label>Did the statements and payments search in Sherlock bring back any further details that relate to the issue?</label></p>
         <p><label> Please provide details below or attach screenshot:</label>
         <p>
            <textarea id="taxOut_search" name="taxOut_search" class="required" cols="90" rows="1" class="required">
            </textArea> *
            <br />
            <br />
         <p><label>Please prodive any further details that might be relevant to the issue:</label></p>
         <textarea id="taxOut_further_details" name="taxOut_further_details" class="required" cols="90" rows="1" class="required"></textArea>
         *
      </div>
      <div id="otherDiv" class="greyBox">
         <p><label>Please state the problem below and provide as much detail as possible (along with relevant screenshots):</label></p>
         <textarea id="other_details" name="other_details" class="required" cols="90" rows="5" class="required"></textArea>
         *
      </div>
   </div>
</div>

按钮:

<p><input type='button' value='Add another issue' id='addButton' class='addButton' style='width: 200px; height: 40px' /></p>

谁能看到我哪里出错了?

0 个答案:

没有答案