JQuery Remove() doesn't work

Posted by Xander Guerin on Stack Overflow See other posts from Stack Overflow or by Xander Guerin
Published on 2011-12-22T00:45:36Z Indexed on 2012/11/30 11:05 UTC
Read the original article Hit count: 207

Filed under:
|

I have a DIV element inside another as follows:

<div id="filters">
    <div class="filterData">hello</div>
</div>

and I'm trying to remove the element:

$("#filters").remove('.filterData');

Problem is, it doesn't. I've tested on other elements on my page and it works. The thing is, I cannot append to it, show or hide it, use .empty. I've also changed it to be a DIV with 'filterData' as the ID and told JQuery to remove it but it refuses to...

Has anyone had a stuborn element like this before?

EDIT: I'm also trying to remove it inside a $(document).ready function so I have no idea.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about element