element.href will get the whole href
Fiddle
EDIT:
I will quote something from the jQuery site here:
The .prop () method should be used for boolean attributes / properties and for properties that do not exist in html (e.g. window.location). All other attributes (which you can see in html) can and should continue to be manipulated using the .attr () method.
Since .attr() gets the actual value entered in the attribute, since it probably used its own getAttribute() , the right way to do this would be to get your own javascript element and then use native element.href , which will get href, including domain and path etc.
source share