How to append div inside other div

后端 未结 5 1581
北荒
北荒 2021-01-26 03:37

I want to append div inside mytext div but it is updating text outside of the div




        
5条回答
  •  借酒劲吻你
    2021-01-26 03:51

    jj refers to 'body' element.

    $(function () {
        var $mydiv = $('
    min
    '), $body = $('body'); $body.append('
    '); var $mytext = $body.find('.mytext:last'); $mytext.append($mydiv); })

提交回复
热议问题