当只有一个按钮元素(显然是DOM的一部分)可用时,我试图检索完整的DOM结构?
$(this) = <button class="btn" id="addBtn" data-toggle="modal" data-target="#addModal"><span class="add"></span> Add...</button>
由于
答案 0 :(得分:0)
$("html").bind("DOMSubtreeModified", function()
{
// when a change is made in the DOM, this gets fired
if($('#idOfYOurElement')!==undefined)
{
var oEntireDom = $('html').html(); // if you want the content in html
});
答案 1 :(得分:0)
$("html").html();
会给你完整的DOM