日期:2014-05-16 浏览次数:20380 次
var xmlFile = "<html> <body> <input> 1 </input> </body> </html> "; var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); xmlDoc.async = false; xmlDoc.loadXML(xmlFile); var xmlnode = xmlDoc.selectSingleNode("//body"); var newnode = xmlDoc.createNode(1,"input",""); newnode.text = "2" ; xmlnode.appendChild(newnode); alert(xmlDoc.xml);
------解决方案--------------------
楼主百度一下,js操作文件