I want to clear old search query everytime I make new search

I would like to clear old search query when I make new search query. I tried doing like this but it doesn’t work for me.

export const clearSearchQuery = () => {
    elements.movieSearched.innerHTML = '';

The movie__Searched class is not clearing but I managed to clear the movie__Container which essentially hold movie posters using same technique .

I have attached an example of my html below.

<main class="film-posters">
 <div class="movie__searched">

                        <h1>&ldquo;search for Scarface&rdquo;</h1>

            <div class="movie__container">

                <div class="movie__result">

                    <img src="img/nat-1.jpg" alt="Photo 1" class="movie__photo">

                    <div class="movie__details">

                        <h3 class="movie__name">Rambo first blood</h3>




If you’re trying to remove everything from your <div class="movie__searched">
You could just let movieSearched = document.getElementsByClassName("movie__searched") which will give you a list. So assuming this is the only place you’re using this class, you could just say movieSearched[0].innerHTML = "";
Something like this

I display the search query here like this.

Then this instantly clears the search query movieSearched[0].innerHTML = "";

However I want to clear the search query only when the user makes a new search query.

So you have to find out what starts the action of when the user makes a new search query.