var elem1=[]; var elem2=[];
var a = document.getElementsByClassName('ab1'); alert('class>'+a.length);
var b = document.getElementById('g2'); elem1.push(b); alert('id>'+elem1.length);
var c = document.getElementById('g1'); elem2.push(c); alert('id>'+elem2.length);
|