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

92
Views
How to display elements with identical class with button in html/js
<button class="edit">EDIT PROFILE</button>
<div class="display">
<input  type="file" name="profpic" accept="image/png, image/jpeg" 
style="max-width:480px;max-height:480px;">
</div>

I have few elements with class display and i want them to be displayed together with single button, but i can't find solution.

let btn = document.querySelector('.edit');
let prof = document.querySelectorAll('.display');
btn.onclick = function(){
  prof.classList.toggle("edited");
};

ofc css class display is set to none and edited is set to flex

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