![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
24/02/2009, 17:44
|
![Avatar de jeybi](http://static.forosdelweb.com/customavatars/avatar249633_1.gif) | | | Fecha de Ingreso: julio-2008 Ubicación: Mexico
Mensajes: 130
Antigüedad: 16 años, 6 meses Puntos: 10 | |
Respuesta: Identificar si un parametro es un atributo o un evento Pues puede que esto quiza te sirva:
function checkAtrrs(elemento){
var attrs = [];
//La funcion solo adimte un elemento, si se le pasan mas, solo validara el primero
if(typeof elemento != 'object')
elemento = elemento.item(0);
if(!elemento.hasAttributes())
return false;
for(var atributo = 0;atributo < elemento.attributes.length; atributo++){
var evento = elemento.attributes[atributo].name;
if(/^on(.*)/i.test(evento))
attrs.push(true);
else
attrs.push(false);
}
return attrs;
}
Puedes modificarla para que te regrese lo que tu desees. |