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

156
Views
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 answers
Answer question

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 Report
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!