Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/02/2009, 17:44
Avatar de jeybi
jeybi
 
Fecha de Ingreso: julio-2008
Ubicación: Mexico
Mensajes: 130
Antigüedad: 15 años, 10 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.