开发者

Prepend not working on Chrome

开发者 https://www.devze.com 2023-03-26 03:26 出处:网络
JQuery prepend is not working in Chrome. I have this code: $(\'#c1\').parent().parent().prepend(c1); The unmodified HTML:

JQuery prepend is not working in Chrome. I have this code:

$('#c1').parent().parent().prepend(c1);

The unmodified HTML:

<span><div><div><img id='c1' /></div></div></span>

It doesn't prepend the image to the span. Please 开发者_开发知识库guide.


I think you need this.

    var c1 = $('#c1');
    c1.parent().parent().prepend(c1);


try this:

 $('#c1').prependTo($('span'));
0

精彩评论

暂无评论...
验证码 换一张
取 消