Is it correct that this code
$('<param><div></div></param>')
produces this output?
[<param>, <div></div>]
whereas with most other tags (eg:section)
$('<section><div></div></section>')
produces
[<section>...</section>]
In other words, jquery seems to remove elements inside a param element and place them alongside it. I’m aware that you usually wouldn’t be placing dom elements inside a param tag. But I’m using jquery to traverse a XML document, and have run into this issue.
What would the workaround be?
As I said in the comment, jQuery expects HTML not XML, in HTML
paramis a self closing tag and cannot have child nodes so jQuery fixes that for you.You can try:
Which gives: