开发者

innerHTML to view XML content in a div

开发者 https://www.devze.com 2022-12-09 13:04 出处:网络
开发者_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

开发者_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

精彩评论

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