getAttribute() works with any attributes, like href from a elements.
getAttribute()
href
a
Make sure to pick "a", followed by "href".
"a"
"href"