HTML: // this div is working, showing the sensor
// I want show inside the form but is not working.
javascript: function obtenirVariables(){ var uniqueURL = "/reqEtatVariables" + "?aleatoire=" + Math.trunc(Math.random() * 1000000); var request = new XMLHttpRequest(); // http://www.toutjavascript.com/reference/ref-xmlhttprequest.php request.onreadystatechange = function() { if (request.readyState == 4) { if (request.status == 200) { document.getElementById("sensor0").innerHTML = this.responseXML.getElementsByTagName('sensor0')[0].childNodes[0].nodeValue; } } } } XML function void handleXML(){ XML=""; XML+=""; XML+=""; XML+= pumpstate; XML+=""; XML+=""; server.send(200,"text/xml",XML); } server.on("/reqEtatVariables",handleXML);