Skip to content
Advertisement

Tag: location

Difference between document.URL and location.href

I know that document.URL can not be set, while location.href can. But the Document indicates: URL is a replacement for the DOM Level 0 location.href property. So when would we use document.URL? Answer You can get the document.URL, but you can not set it. You can both get and set the location.href. In some webbrowsers, you are able to set

Advertisement