How to get the href appear on url

I am having problem with getting the href appear on URL when click on the image.

please give more context, right now your question is really cryptic

When i click on the movie I want the href which contains the movie id to appear on URL like #1234545

<div class="single__movie__details" href="#${movie.imdbID}" >

    <div class="single__movie__info">
        <div class="single__movie__info-name">
            <h1 class="movie-name">${movie.title}</h1>
        </div>
        <div class="single__movie__info-release">
            <h1 class="release-date">&#40;${movie.year}&#41;</h1>
        </div>
    </div>

are you using a framework? can you post a link to your project?

This is a vanilla js project.

you can’t use variables in html. You need to do that with JavaScript to build the href.

But I can’t even see what you are doing if you don’t show your code

Movie.imdbID is a property of the movie object which is fetched from an API.

I will send you the link to my code.

is this in your html file? or are you building this with javascript?

I’m building this mark up with Javascript.

are you using backticks for the template literal?

also, please, again, post a link to your project, or your whole code.

It’s not possible to help you otherwise.

This is the link to my project: please see line(16)

what is an example for ‘movie’?

I didn’t catch you. This markup display movie poster and other details about movie.

what is going wrong with the href now?

When I click on the movie poster I’m taking to this page and on the URL the href which contains the movie.imdbID is not displayed.

Are you manipulating the Browser history manually?
Because the url bar will change only if you pass the url param.

I found the solution. I forgot to put the anchor tag <a></a> in the div.

  <a class="single__movie__details" href="#${movie.imdbID}" >