Copy specific part of a browser URL Bar

I’m trying to figure out a way to copy only a specific part from the URL Bar, any assistance is appreciated!

The link goes something like

I want the command to copy the /ACCOUNTNAME/ bit from the link. |

Tried something like:

var el = document.createElement('a');
el.href = "";        //
el.hostname    //
el.hash        // #photos
el.href        //
el.pathname    // /show/search
el.protocol    // http:      // ?filter=a

Now I’ll have you know that I’m a complete beginner so please don’t murder me on the comments, all help is appreciated and massive thanks in advance for anyone willing to assist.


82 thoughts on “Copy specific part of a browser URL Bar”

Leave a Comment