-6

I have an html table with few rows. in that for few rows someClass is applied.

My request is how can i delete the rows of specific class type?

<table>
<tr class="someClass"> ...</tr>
<tr class="someClass"> ...</tr>
<tr class="anotherClass"> ...</tr>
<tr class="someClass"> ...</tr>
</table>

Now i have to delete all the rows whose class type is someClass using jquery. How can i do that?

Thanks!

user1016403
  • 11,631
  • 34
  • 103
  • 135

5 Answers5

6
$('table tr.someClass').remove();
Igor Dymov
  • 15,840
  • 4
  • 48
  • 54
2

You can do this:

$('.someClass').remove();
palaѕн
  • 68,816
  • 17
  • 108
  • 129
2

How's this?:

$(".someClass").remove();

mahdilamb
  • 522
  • 3
  • 9
1
$('.someClass').remove();

hope this helps.

Jake Aitchison
  • 1,039
  • 6
  • 20
1

first you should indentify the event, and write the event handler then use the shared code.sample event is on click something and perform the operation

$('.someClass').remove();//

TRY to GOOGLE, you will get a lots of samples.

Maneesh Kumar
  • 1,317
  • 2
  • 9
  • 13