Good day! There is a certain 4x4 table, you need to select a row and split the columns of the selected row (the unique identifier "tabindex = 0" is assigned to the selected row).
My decision:
$("tbody").click(function () { var itemId = $("tbody").find("[tabindex='0']").find("td:eq(0)").html(); // первый элемент td var itemOb = $("tbody").find("[tabindex='0']").find("td:eq(1)").html(); // второй элемент td var itemCn = $("tbody").find("[tabindex='0']").find("td:eq(2)").html(); // третий элемент td var itemZn = $("tbody").find("[tabindex='0']").find("td:eq(3)").html(); // четвертый элемент td });
Maybe you can do something better, and even in my version, when you click each time, the value of the selected line will be selected, how can you make the value selected once?