-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

2

this you want :

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

Working Fiddle

Ehsan Sajjad
  • 61,834
  • 16
  • 105
  • 160
0

Just try with remove:

$('.ikur').remove();
hsz
  • 148,279
  • 62
  • 259
  • 315
0

You can use .remove():

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

For example:

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

Working Demo

Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125
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
  • 19,469
  • 39
  • 180
  • 373