Jquery - Hide specific div
Posted
by Jova
on Stack Overflow
See other posts from Stack Overflow
or by Jova
Published on 2010-03-09T09:53:03Z
Indexed on
2010/03/09
10:06 UTC
Read the original article
Hit count: 230
I have several divs that share a common class. If one of these divs do not have a child div, I want to hide the div. I can find the right div but I'm unable to hide it.
This is my code,
$(function() {
if ($(".adRight.childen('div')").length == 0) {
$(this).hide();
}
});
What should I use instead of (this)? this refers to the document and not the div the if-statement found.
© Stack Overflow or respective owner