___ erkimt ___ css selector syntax for deleting td element with jQuery ______ qstntxt ___
Some way to use jquery and selectors in a similar way?
$("#tabela td").closest('tr').empty(); // ou .remove();
I need to delete only the .closest('tr')
lines that contain tr
of a table like this, but not the %code% lines that have %code% elements.
As I'm doing, it deletes the %code% , but not the %code% that contains %code% .
$("#tabela td").closest('tr').empty(); // ou .remove();
I suggest doing as started and add %code% so it rises to the element %code% and can remove it.
%pre%
Example: link
I had not used it like this before, but I think it's okay to continue using it. In my case, I usually use the closest ( link ) and remove it ( link ), passing the element that received the click.
For example:
%code%
%code%
Your selector is almost correct.
For the HTML markup below
%pre%
This JS code solves the problem
%pre%
Example: link
Edit1 to meet the requirement