Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

115
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda