for (var i = 0; i<points.length; i++){
var wapper = document.createElement("div");
wapper.id="wapper_Id";
document.getElementById("wrapper").style.zIndex=0;
var img = document.createElement("img");
document.body.appendChild(img);
img.setAttribute("id","img_Id");
img.setAttribute("name","oImg");
img.src =points[i].p;
img_width=img.width;
img_height=img.height;
// Pixel diff from left upper
xp[i] = (points[i].x - lux) / ws.map.scale;
yp[i] = (luy - points[i].y) / ws.map.scale;
img.style.position = "absolute";
img.style.left =xp[i]-img_width/2+ "px";
img.style.top = yp[i]-img_height/2 + "px";
wapper.appendChild(img);
document.body.appendChild(wapper);
obj[i] =img;
//img.style.visibility = "hidden";
}
return obj;我想用document.getElementByTagName方法,得到wapper集合的length,该怎么写,
var wapper = document.createElement("div");
wapper.id="wapper_Id";
document.getElementById("wrapper").style.zIndex=0;
var img = document.createElement("img");
document.body.appendChild(img);
img.setAttribute("id","img_Id");
img.setAttribute("name","oImg");
img.src =points[i].p;
img_width=img.width;
img_height=img.height;
// Pixel diff from left upper
xp[i] = (points[i].x - lux) / ws.map.scale;
yp[i] = (luy - points[i].y) / ws.map.scale;
img.style.position = "absolute";
img.style.left =xp[i]-img_width/2+ "px";
img.style.top = yp[i]-img_height/2 + "px";
wapper.appendChild(img);
document.body.appendChild(wapper);
obj[i] =img;
//img.style.visibility = "hidden";
}
return obj;我想用document.getElementByTagName方法,得到wapper集合的length,该怎么写,
var table = document.getElementById("forecast-table");
var cells = table.getElementsByTagName("td");
for (var i = 0; i < cells.length; i++) {
status = cells[i].getAttribute("status");
if ( status == "open") {
// grab the data
}
}