0

for example:

<ul>
    <li id="l1"></li>
    <li id="l2"></li>
    <li id="l3"></li>
    <li id="l4"></li>
    <li id="l5"></li>
</ul>

how can I remove a row?

Poya Eraghi
  • 125
  • 1
  • 8

3 Answers3

4
$('#l1').remove();  // To remove specific element that has id

$('li').remove();   // To remove all li's

$('.l1').remove();  // To remove elements with class l1
Sushanth --
  • 55,259
  • 9
  • 66
  • 105
2

You can remove:

/**
id is a variable that you can get from anywhere wish you
**/

$("#l"+id).remove();

Other option more specific

$("#l1").remove();
chenio
  • 592
  • 3
  • 11
  • 27
1

Use remove() jQuery function.

Try with: $('#l1').remove(); for removing the single li element.

jacoz
  • 3,508
  • 5
  • 26
  • 42