how to find a table with a certain row id, add a class to the row and call button click using jquery -
i have table rows. each rows has id assigned e.g. , cell containing button.
<tr id="69"> columns data <td><input type="submit" name="select" /></td></tr> <tr id="68"> columns data <td><input type="submit" name="select" /></td></tr> <tr id="72"> columns data <td><input type="submit" name="select" /></td> </tr>
using jquery how can find row id '68' , add class hightlight
, fire click event of select
button present inside row
i m trying on these lines
$('#templatesite tr').find('#'+data.siteid).addclass('highlight');
where data.siteid value 68
any ideas?
you looking tr child id of id. try:
$('#templatesite tr#'+data.siteid + " td").addclass('highlight'); $('#templatesite tr#'+data.siteid).find("input[type='submit']").trigger('click');
Comments
Post a Comment