-2

I've been trying to remove a div based on its class value, but I fail to succeed. You might say that I can use the ID instead, but this element doesn't have any ID.

<body class="home_page">
<div id="visas">
<div class="ikur"> <!-- I want to remove this div -->
...
</div>
</div>
</body>
user3541250
  • 13
  • 1
  • 4

4 Answers4

1

this you want :

$(function() {
    $('div.ikur').remove();
});

Working Fiddle

Ehsan Sajjad
  • 60,736
  • 15
  • 100
  • 154
0

Just try with remove:

$('.ikur').remove();
hsz
  • 143,040
  • 58
  • 252
  • 308
0

You can use .remove():

$('.classname').remove();

For example:

$('.ikur').remove();

Working Demo

Milind Anantwar
  • 79,642
  • 23
  • 92
  • 120
0

Use jQuery .remove() jQuery help link

Example in your case if you want to remove div based on class name then use following

$('.ikur').remove();

I have set up a fiddle example incase you want to remove div under specific wrapper div or may want to remove all div with particular call example

You can play around & make it work according to your requirements

Learning
  • 18,542
  • 37
  • 165
  • 337