I want to convert an xml element like this:
<asin>B0013FRNKG</asin>
to string in javascript
I used XMLSerializer
:
new XMLSerializer().serializeToString(xml);
the string only shows on alert() and in the console. On the page it just says
[object Element][object Element]
I want to get the string.
"<asin>B0013FRNKG</asin>"
, or"B0013FRNKG"
? – Zeebrugge