Some attributes are directly accessible as properties of the element (e.g. alt, href, id, title and value).
var a = document.querySelector("a"),
url = a.href;
Other attributes, including data-attributes can be accessed as follows:
var a = document.querySelector("a"),
...