I need to retrieve the bottom border width of the cell above the clicked cell.
var $this = $(this);
var col = $this.parent().children().index($this);
var row = $this.parent().parent().children().index($this.parent());
var bordWidth= ($this.parents('tr:eq('+(row-1)+')').find('td:eq('+col+')').css("border-bottom-width"));
Try this.
var $this = $(this);
var $tr = $this.parent();
var col = $tr.children().index($this);
var bordWidth = $tr.prev().children().eq(col).css("border-bottom-width");
.prev()
will get the previous tr
element and then using .children()
get all the td
's and get the required td using eq()
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With