简体   繁体   中英

insertBefore() with multiple selectors class

I try to do that :

$("<div class='line line1'></div>").insertBefore(".anim-letters .wpb_wrapper .text-wrapper");

The div is insert after .anim-letters and no after .text-wrapper why ? I'm obliged to add that with jquery because it will be so difficult to find the line in php code of wordpress plugin.

我已经解决了我的问题,但是我想知道为什么insertBefore()无法做同样的事情。

$(".text-wrapper").prepend("<div class='line line1'></div>");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM