191
rated 0 times
[
194]
[
3]
/ answers: 1 / hits: 6880
/ 10 Years ago, sat, march 8, 2014, 12:00:00
I'm trying to get the HTML form of some objects(including text), using jquery contents. Here's what I got until now:
HTML
<div id=mydiv>
test
<p>foo</p>
<p>bar</p>
</div>
jQuery
$('#mydiv').contents().each(function(){
console.log($(this).html());
console.log($(this).prop(innerHTML));
console.log($(this).prop(outerHTML));
});
Is there any way to do this? I've searched around but I couldn't find anything.
Thank you in advance for the answer!
More From » jquery