Print out jQuery object as HTML

后端 未结 3 1653
再見小時候
再見小時候 2020-12-29 23:20

Is there a good way of printing out a jQuery object as pure HTML?

ex:





        
3条回答
  •  青春惊慌失措
    2020-12-29 23:53

    You could wrap it and then use html:

    var img = $('img').eq(0);
    console.log(img.wrap("").parent().html());
    

提交回复
热议问题