0
Rows and lines defining
I'm trying to highlight the rows and lines of each number when it's pressed. But some of the numbers highlight the wrong lines/rows. How can I fix it? https://code.sololearn.com/WbSzkt2tDa9J/?ref=app UPDATE: fixed it by searching by the index of the html element instead of searching by the numbers (due to repeating numbers/values).
7 Antworten
+ 3
You can store the element index as a user defined data on the tr dom element. Retrive it to access the array getting line and row that way.
https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
+ 4
One last issue would be picking the row or line element as the blue is changed to red. You may or may not want this behavor.
+ 2
Part of your issue is you start with line on 27 & finish with row on 29 and reverse it for 31 & 33. Both usages in the pair should be the same. The rest of your issue is duplicate table values. Your search for the value will find the wrong one.
+ 1
Thank you very much!
+ 1
Yes I was going to fix that after I fix the row and lines issue👍
0
I don't know exactly but I noticed that same numbers has same row line
0
how can I fix the duplicate table values issue?