我有一个 set html 的 snipper。基本结构是
<div>
<div></div>
<div class="some_class another_class ticket_print_wrapper visible"></div>
</div>
所以我想通过代码插入另一个按钮。为此,我正在使用(目前粗略):
$(".ticket_print_wrapper").insertAfter("<p>Moo</p>");
这里有一个jsfiddle: http://jsfiddle.net/Zmxpt/
它似乎不接受 ".ticket_print_wrapper"
作为对象。谁能打破我在这个问题上的不眠之痛,好吗?
最佳答案
使用 $(".actions").append("<p>Moo</p>");
如果您想使用两个按钮在同一级别添加其他内容。
关于javascript - 类选择器在我测试时返回 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24943273/