var attributes = document.getElementById('idgoeshere').attributes;
// OR
var attributes = $('#idgoeshere')[0].attributes; alert(attributes[0].name); alert(attributes[0].value);