Skip to content
Advertisement

how to select $(this) inside a template literal js expression?

I know that every time I call “this” inside the function it will select whatever selector have given it in arguments but how could use template literal like this and get the index of the row generated in the append method ?

JavaScript
JavaScript

Advertisement

Answer

You’ll need to find the tbody, and see the number of children of that element to get a counter:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement