jeremyll
asked on
Jquery - .remove() bug
I'm trying to remove empty UL tags using Jquery below:
$("ul").each(function(){
if ($(this).find("li").length == 0) {
$(this).remove();
// $(this).css("border","20px solid red");
}
});
The strange thing is the $(this).remove(); doesn't work, whereas $(this).css("border","20px solid red"); in the code above works!
Are there any known bugs with .remove() ?
$("ul").each(function(){
if ($(this).find("li").length
$(this).remove();
// $(this).css("border","20px
}
});
The strange thing is the $(this).remove(); doesn't work, whereas $(this).css("border","20px
Are there any known bugs with .remove() ?
please provide the html
here is the working one..
http://jsfiddle.net/Sudhindra/6hybe/
Please post the complete code (html)...
BR- Sudhindra-www.clicksperday.com
http://jsfiddle.net/Sudhindra/6hybe/
Please post the complete code (html)...
BR- Sudhindra-www.clicksperday.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I dont see any bugs and is doing what it has to do..
BR-Sudhindra-www.clicksperday.com