Get HTML element ID from URL

Let’s say I have a URL like this:

How do I fetch the ID with jQuery? What I want to do is to fetch it and then display content in a <div> that depends on the ID value. Do you know how to do that?

Thanks and best regards folks!

Convenient because window.location.hash will just return “#id” so you can use it directly as a jquery selector:

$(window.location.hash).html('content to go in DIV');