I'm trying to have every attribute's names and values of an element of the DOM using jQuery and JavaScript. I've written this piece of code:
$.each(attribute.attributes, function (ident, attrib) {
alert(attrib.value);
alert(attrib.name);
});
"attribute" is an attribute of the DOM. I've found .attributes method online but I don't know why the program crashes entering in this function.