-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
  • 12,151
  • 35
  • 108
  • 137

5 Answers5

6
$('table tr.someClass').remove();
Igor Dymov
  • 16,230
  • 5
  • 50
  • 56
2

You can do this:

$('.someClass').remove();
palaѕн
  • 72,112
  • 17
  • 116
  • 136
2

How's this?:

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

mahdilamb
  • 535
  • 3
  • 11
1
$('.someClass').remove();

hope this helps.

Jake Aitchison
  • 1,079
  • 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,367
  • 2
  • 9
  • 13