本文介绍了为什么我的jquery在几秒钟后消失了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好我需要帮助,我有一个克隆div的按钮,但几秒后克隆的div消失了
Hi guys i need a help here, i have a button that is cloning a div, but after a few seconds the cloned div is disappearing
<b>HTML Code:</b> <pre lang="Javascript"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div class="panel-body" style="overflow: auto; height: 659px;"> <div class="personalInfo"> <table class="tableOverride table-responsive"> <tr> <th>Mobile Number: </th> <td> <asp:TextBox ID="txtBoxMobileNum" runat="server" CssClass="form-controlOverride"></asp:TextBox> </td> </tr> <tr> <th>Home Number: </th> <td> <asp:TextBox ID="txtBoxHomeNum" runat="server" CssClass="form-controlOverride"></asp:TextBox> </td> </tr> <tr> <th>Personal Email: </th> <td> <asp:TextBox ID="txtBoxPersonalEmail" runat="server" CssClass="form-controlOverride"></asp:TextBox> </td> </tr> </table> </div> <div> <div class="text-center"> <button id="clonePersonalInfo" class="btn btn-default" style="height: 30px; text-decoration: underline;">Add Contact Information</button> </div> <div class="pull-left"> <asp:Button ID="btnSavePersonalInfo" runat="server" Text="Save" Width="100px" Height="30px" CssClass="btn btn-primary" /> </div> </div> </ContentTemplate> </asp:UpdatePanel> </pre>我尝试过: jquery代码:
What I have tried: jquery Code:
$(document).ready(function () { $('#clonePersonalInfo').click(function () { $('div.personalInfo').after(function () { return $(this).clone(); }); }); });推荐答案
( document )。ready ( function (){ (document).ready(function () {
(' #clonePersonalInfo')。click( function (){ ('#clonePersonalInfo').click(function () {
(' div.personalInfo')。after( function ( ){ return ('div.personalInfo').after(function () { return
更多推荐
为什么我的jquery在几秒钟后消失了?
发布评论