Inside the event listener, a variable row is declared which stores all the table row elements in the form of an array as the spread operator is used to convert the node list returned from the querySelectorAll() method to an array. We filter certain rows from all rows using the filter() method, passing a parameter element within it. The condition to filter the rows is that if the row is not clicked, we should hide it using the display property which is set to the value of none.
Example: In this example, we are using the above-explained approach.
Please Login to comment...