For <a href="https://domain.com/path">link</a>
give anchorElement.pathname == "path"
, should be "/path"
.
Note: It's not the case for document.location
and window.location
.
- ✅ IE 9
- ❎ IE 10
- dom
- url
- anchor
For <a href="https://domain.com/path">link</a>
give anchorElement.pathname == "path"
, should be "/path"
.
Note: It's not the case for document.location
and window.location
.