get full url javascript with ID element code example Example: javascript get url path window.location.pathname