im trying to get a element from the url html file. element <td>Thu Dec 18 10:33:19 EST 2014</td> which is in the url html page that is passed into loadHTML function. which sends the html page string to another function called handler. from the parser is it possible to get the specific .
function loadHTML(spanId, url) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 /* complete */) {
handler(xmlhttp.responseText, spanId);
}
};
xmlhttp.send();
}
function handler(responseText, spanId) {
var parser =new DOMParser();
parser.getDocument()
//get the date/time from parser
var dateTime = …
//get class name from parser
var className = …
var span = document.getElementById(spanId);
span.innerHTML = dateTime;
span.className = className;
}