This works in Chrome and FF, but not Safari :/
var content = '<div><span><p>Can you catch me?</p></span></div>';
content = $.parseXML(content);
var span = $(content).find('span').html();
I need the output as a string. And I would prefer nothing to be put into the DOM.
In Chrome and FireFox it outputs
"<p>
Can you catch me?</p>
"
Which is what I want.
If you dump this JS into the Safari console, you get a document output, but its the whole thing, not just the span.
Can you catch me?
" – dezman Feb 26 '14 at 19:54