Get HTML String for jQuery and/or DOM object

后端 未结 3 540
南方客
南方客 2021-01-13 22:21

I think I\'ve read through the complete jQuery API documentation and looked at jQuery objects and simple DOM elements in the debugger to check what methods they actually hav

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 23:12

    You can use the '.outerHTML' property. This is how it would look using jquery: http://jsfiddle.net/MHvmm/

    $('div')[0].outerHTML
    

提交回复
热议问题