我想获取 html,包括我用来获取 html 的选择器
假设我有
<div id="foo">
<div id="bar">content</div>
</div>
当我执行 $('#foo').html()
时,我得到了
<div id="bar">content</div>
在 jquery 中有没有办法获取整个 html,包括父级(选择器 div)
我想要整个 html
<div id="foo">
<div id="bar">content</div>
</div>
最佳答案
关于javascript - 获取完整的 html 而不仅仅是 innerhtml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11070672/