I have a table containing a list of users and I would like to hide all their duplicates on an event. an example in the image below is hiding the second tr#user-3.
But when I tried using temp1.querySelectorAll('tr:not(#user-3:first)')
it didn't return any node instead and it brings invalid selector error. What could be the cause and how do I solve it ?
:first is not part of the CSS spec, this is jQuery specific.
To access the first and last elements, try.
var nodes = temp1.querySelectorAll('tr');
var first = nodes[0];
var last = nodes[nodes.length- 1];