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

161
Visualizações
how to hide a div if another div has a special attribute

I have the following structure, what I want to achieve is that if the point class has the "black" attribute, the button does not appear. Someone who can help me please

     <div class="container" > 

         <div class="card" > 
           <div class="button" > button </div>
            <div class="colors" > 
             <div value="black" class="point"> </div>
             <div value="white" class="point"> </div>
            </div>
           </div>
         </div> 


        if ($('.point').attr("value") == "black") {
              $(".button").hide();
         }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Select everything with the class point which has a specific attribute (in this case value="black"). Then find the sibling of the parent div with the class .button and hide it. No need for the if statement.

$('.point[value="black"]').parent().siblings(".button").hide();
about 4 years ago · Juan Pablo Isaza Relatório
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