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
Trigger the function of checked boxes to one button js

I wanted to if I could do this with only using javascript. I have a pdf links on each of my checkboxes. So if the selected checkboxes are checked then it would go to that links but only when the button is clicked.

$(function() {
  $("input[name='check[]']").bind("myCustomButtonClick", function() {
    var item = $(this);
    if (item.is(":checked")) {
      item.siblings('a.dev-link').trigger('click');
    }
  });
})

$(document).on('click', '#dl-link', function() {
  $("input[name='check[]']").trigger("myCustomButtonClick");
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<label id="link" class="w-checkbox dl-check-wrap">
  <div class="w-checkbox-input w-checkbox-input--inputType-custom dl-check dev-check w--redirected-checked"></div>
  <input type="checkbox" name="check[]" data-name="check[]" id="mode">
  <a href="https://drive.google.com/uc?export=download&amp;id=17XNOXQ3dKZM9tznx4xGk8I0O5hcvw0kc" class="dl-link dev-link">Link</a>
  <span class="d-none w-form-label" for="check[]">Checkbox 4</span>
</label>

<a id="dl-link" href="#" class="dl-btn w-button">Download All</a>

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!