Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<style>
table,th,td {
border : 1px solid grey;
border-collapse: collapse;
}
th,td {
padding: 5px;
}
</style>
<body>
<table id="demo"></table>
<script>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myFunction(this);
}
};
xhttp.open("GET", "XMLFile.xml", true);
xhttp.send();
function myFunction(xml) {
var i;
var xmlDoc = xml.responseXML;
var table="<tr><th>TECH</th><th>SIDE</th></tr>";
var x = xmlDoc.getElementsByTagName("LANG");
for (i = 0; i <x.length; i++) {
table += "<tr><td>" +
x[i].getElementsByTagName("TECH")[0].childNodes[0].nodeValue +
"</td><td>" +
x[i].getElementsByTagName("SIDE")[0].childNodes[0].nodeValue +
"</td></tr>";
}
document.getElementById("demo").innerHTML = table;
}
</script>
</body>
</html>
// this xml code put into XMLFile.xml
<TECHNOLOGY>
<LANG>
<TECH>Javascript</TECH>
<SIDE>client</SIDE>
</LANG>
<LANG>
<TECH>PHP</TECH>
<SIDE>server</SIDE>
</LANG>
<LANG>
<TECH>Node.js</TECH>
<SIDE>server</SIDE>
</LANG>
<LANG>
<TECH>jQuery</TECH>
<SIDE>client</SIDE>
</LANG>
</TECHNOLOGY>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 507