Is there a way using HTML css and JavaScript that I can find the URL of a webpage after the first 10 characters. For example, if the URL is random.com/abc the program would only get the /abc part of the URl and log it in the console. How can this be done?
You need to get the pathname from the window location object.
window.location.pathname
You can use window.location.href along with substring() to select a range of characters or characters after a particular index.
window.location.href.substring(10);
To get the path, use the pathName.
console.log(window.location.pathname);
console.log((new URL('http://www.example.com/abc/123')).pathname);
There is no reason to split and use indexes.