【发布时间】:2019-11-07 01:01:44
【问题描述】:
$("#addSelect").click(function() {
$("#optionsForm").after("Hello world.");
} );
这行得通。
$("#addSelect").click(function() {
$("#optionsForm").after("<tr>
<td><input type="text" class="optionField" value="Options" /></td>
<td>
<ul class="option">
<li><select><option>Value..</option></select></li>
</ul>
</td>
</tr>");
} );
这样的事情不会。
在 Chrome 中,我收到错误“Unexpected token ILLEGAL”。谷歌搜索后,我发现我的小脑袋对 javascript 和多行代码知之甚少。所以我在每行的末尾添加了“\”。然而,我现在收到错误“Unexpected identifier”。
我希望这不会像我做的那么难:)
【问题讨论】:
标签: javascript jquery