Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Trying to replace carousel's existing content with new content when the button is clicked again

I have 4 carousels that each display text info from an API when the user inputs content into a search bar and clicks search button. When the user repeats the process, is there a way I can remove existing text info and replace it with the new info the API fetches?

var getMovie = function (event) {
    // gets button element
    var inputEl = document.querySelector(".validate");

    // retrieves button element text data
    var movie = inputEl.value.trim();
    movie = movie.toUpperCase();
    
    // calls retrieveData function
    retrieveData(movie);

    // clear input field
    inputEl.value = "";
};

var displayMovie = function (data2, movie, data) {
    saveMovie(movie);

    mainContentEl.style.display = "block";

    var reviewData = data;

    // get movie data
    var movieData = data2;

    // calls carousel builder functions
    // scale the headers of the cards down
    // enlarge the content font slightly to fill the card
    carouselItemOne(movieData, movie);
    carouselItemTwo(movieData, movie);
    carouselItemThree(reviewData, movie);
    carouselItemFour(movieData, movie);
};
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!