Given
var html = "<html><body><p>Hello, World!</p><p>Ciao!</p></body></html>";
I would like to extract the inner HTML of the body
tag (<p>Hello, World!</p><p>Ciao!</p>
).
.find()
finds the body
DOM node
var body = $(html).find("body");
but I cannot find a means to get the inner HTML of that node. I tried:
var text = body.text(); // returns ""
var var = body.var(); // returns undefined
How can I get a string representation of the <body>
tag's inner HTML?
` tags.
– aroth Feb 12 '13 at 04:24