node.attr
could be both getter and setter.
If you pass second argument to attr, it will be set as value of the attribute (the first argument).
node.getAttribute
is only getter.
node.getAttribute
normalizes the value for IE and especially for IE < 8. Without falling in many details, this means you may pass w3c standard attribute and it will work on all browsers.
Hope that helps!