我想使用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>");
但我收到的错误是预期'('
该错误是按钮代码启动的位置。 单独的文本(而不是按钮控制)代码工作正常。有人可以帮我解决吗?
答案 0 :(得分:0)
你需要逃避你的报价...
<asp:button ID="btnProceed" runat="server" Text="Proceed">
需要成为
<asp:button ID=\"btnProceed\" runat=\"server\" Text=\"Proceed\">
另请注意
<button onclick="doSomething()">Click Me</button>