lundi 11 janvier 2016

jquery find and click image in table row, on checkbox checked

I have an ASP Gridview that has an img tag in one column and a checkbox in the next column. I would like to fire the click event (for the selected row) that I've put on the img when the user checks the checkbox if the src of the image includes a certain string.

Putting this $("[src*=plus]").trigger("click"); in the click event of my checkbox works, but it fires the event for every row, not just the one the selected checkbox is in. I've tried several things, the latest being $(this).closest("tr").child("[src*=plus]").trigger("click");, but I have been unable to get it to fire for just the one row.

How do find the correct img tag and fire it's click event?




Aucun commentaire:

Enregistrer un commentaire