I am working on a reservation project if someone wants to reserve a spot for the game (Warhammer40K) 4 spots to fill in the table, for that purpose I try to get text of nearest column in which user hover.
For example, If the table has 10 columns divided into 2 rows. If I hover on spot 2, I need to get the text of the column right to column 2, which is 3, and the text of the column below column 2 such as 7 and 8.
Below is the code which helps me to get column 3 text right to column 2.
Any help will be appreciated.
jQuery(".sqr_wrapper tr td").hover(function() {
var spot = jQuery(this).nextAll("td").first().find(".spot").text();
console.log(spot);
});
Here is the table.
