laredotornado <la***********@zipmail.comwrites:
Thanks. How do I 'Get collection of all spans with className
"prescription"'?
There is no single method that does that, so you have to write a
function yourself.
In this case, since you are only looking for "span" elements,
you could use document.getElementsByTagName to get all span
elements in the document, and then run through that and operate
on those with a "className" property containing "prescription".
E.g.
function getPrescriptions() {
var ps = [];
var spans = document.body.getElementsByTagName("span");
for(var i = 0, n = spans.length; i < n; i++) {
var sp = spans[i];
if (/\bprescription\b/.test(sp.className)) {
ps.push(sp);
}
}
return ps;
}
Good luck
/L
--
Lasse Reichstein Nielsen
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'