开发者

innerHTML to view XML content in a div

开发者_JS百科I have a form that I am using innerHTML to view the contents of one div in another div. When the user clicks the button, they should be able to view their template. However I am dragging a tree from an XML file and even though the code runs, I get undefined as an output. Am a newbie at this, so any help would be much appreciated!

Any thoughts?

Thanks!


you can't use innerHTML property with xml, because it's exist only in HTML DOM. You have to use cloneNode() method instead


node.firstChild.data wont work with tree. It works if you have only textNode inside your element.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜