Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/01/2010, 16:54
Avatar de zerokilled
zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Duda sobre getElementById

no existe una funcion estandar para ello, pero puedes crearla. buscando si existe una funcion encontre este codigo obtenido de http://snipplr.com/view/1853/get-elements-by-attribute/
Código:
function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){
var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)", "i") : null;
var oCurrent;
var oAttribute;
for(var i=0; i<arrElements.length; i++){
oCurrent = arrElements[i];
oAttribute = oCurrent.getAttribute && oCurrent.getAttribute(strAttributeName);
if(typeof oAttribute == "string" && oAttribute.length > 0){
if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){
arrReturnElements.push(oCurrent);
}
}
}
return arrReturnElements;
}
no he verificado bien como funciona pero quizas lo intentaria de otra forma.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.