开发者

How to get current row of input control like textbox within html table

I am getting all checkboxes that are in an html table using this code and I need to find the current row in the table from the current checkbox.

            var checkboxes = $("form :checkbox")开发者_如何学C;
            for (i = 0; i <= checkboxes.length; i++) {

                var checkbox = checkboxes[i];

                ///need to get current row in html table here 
            }


  var checkboxes = $("form :checkbox");
    for (i = 0; i <= checkboxes.length; i++) {

        var checkbox = checkboxes[i];

        var rowIndex = $(checkbox).closest('tr')[0].rowIndex;
    }

should do it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜