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

180
Views
Click checkbox with jQuery

I'm building html dynamically with Ajax.

This code generates my table:

$(".row-info").append(`
    <div class="items_container ${value}" id="${value}">
        <div class="col-md-2 item_ref">${value}</div>
        <div class="col-md-6 item_description">${response[0].nombre}</div>
        <div class="col-md-3"><input type="number" class="form-control" value="1" style="width: 100%; text-align:center" /></div>
        <div class="col-md-1"><i class="fas fa-trash-alt fa-2x text-danger remove_line" style="cursor:pointer;"></i></div>
    </div>
`);

$(".remove_line").on("click", function () {
    $(".items_container." + value).remove();
    $("." + value).click();
});

enter image description here

This image it's result for my table created dynamically. I have a red trash image that if clicked it removes a line from the table.

I need to do that when I click remove checkbox checked, but when I clicked in this checkbox, change message.

I tried with: $('.'+value).click(); but my problem is that duplicate my entry in my table, always I can show my item selected. My message change, because detect when it's checked or not. But never remove my table line.

I don't know if have better solution to do this. And solve my problem.

Resume: when i click in checkbox "OFERTA" in left window, create iframe in right. When i check one checkbox in Iframes right I need create table resume in bottom.

Thanks for reading and sorry for my english.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

SOLUTION

$(".remove_line_"+value).on('click', function(){
                                        $(this).closest('.items_container').remove();    
                                        if($("."+value).prop('checked', true)){
                                            $("."+value).click();
                                            $("."+value).prop('checked', false);
                                        }
                                    });
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!