gpt4 book ai didi

jquery - 使用 jQuery 添加带有文本和链接按钮的 div

转载 作者:行者123 更新时间:2023-11-28 03:37:25 25 4
gpt4 key购买 nike

我想使用 jQuery 在 Div 中添加一些文本和一个 asp: 按钮。

代码:

Hi,  <p> Are you sure you want to go ahead</p><p>Please ignore this warning if this is not the first time you are logging in</p>
<asp:button ID="btnProceed" runat="server" Text="Proceed"></asp:button>

实现:

jQ('#proceedDiv').append("<div> Hi,  <p> Are you sure you want to go ahead</p><p>Please ignore this warning if this is not the first time you are logging in</p> <asp:button ID="btnProceed" runat="server" Text="Proceed"></asp:button></div>");

但我收到一条错误消息,提示“(”

该错误是按钮代码开始的地方。使用单独的文本(而不是按钮控件),代码可以正常工作。有人可以帮我解决吗?

最佳答案

您需要转义引号...

<asp:button ID="btnProceed" runat="server" Text="Proceed">

需要成为

<asp:button ID=\"btnProceed\" runat=\"server\" Text=\"Proceed\">

还要注意

<button onclick="doSomething()">Click Me</button>

关于jquery - 使用 jQuery 添加带有文本和链接按钮的 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13361907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com