📜  从 js 访问按钮内的文本 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:06.449000             🧑  作者: Mango

代码示例3
ar all = document.getElementsByTagName('*'); 
for (var i=0, max=all.length; i < max; i++) 
{
var elem = all[i];
if(elem.getAttribute("id") == 'ext-gen26'){
    if(elem.attributes != null){
        for (var x = 0; x < elem.attributes.length; x++) {
            var attrib = elem.attributes[x];
            alert(attrib.name + " = " + attrib.value);  
        }
    }
}
};