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

206
Visualizações
Is possible get attribute value and manipulate tags added by Javascript?

I am trying to integrate an image matcher into a constructor that uses lodash. The builder uses lodash in the live editor and php for the public part. In the public part everything works correctly. But in the editor it doesn't and it shows me the error Uncaught TypeError: this.el is null. which means that the element has not been found. But the element exists only that it is added by lodash. So my question is: Is it possible to get the ID attribute and manipulate elements added by Javascript (lodash)?

Lodash Code

    <# if(image_before.src && image_before.src) { #>
        <div class="image-compare-image">
        <div id="image-compare-1652909731591" class="image-compare-image-ct">
            <img class="sppb-img-responsive" src="source-here" alt="Alt">
            <img class="sppb-img-responsive" src="source-here" alt="alt">
        </div>
        </div>
    <# } #>

JS

    const compare_1652909731591 = document.getElementById("image-compare-1652909731591");
    const viewer_1652909731591 = new ImageCompare(compare_1652909731591).mount();

Thanks

about 4 years ago · Juan Pablo Isaza
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