Skip to content Skip to sidebar Skip to footer

Hide Parent Of Div

I'm simply trying to hide the parent div comments_section.
I tried this:

Solution 1:

Well, you tagged this jQuery so I'll provide the "jQuery way":

jQuery('#comments_section').parent().hide();

EDIT: @bobek gives the reason why your problem occurred in the first place. He is correct. I should note that with jQuery, you'd still have the problem but no error.

Solution 2:

You didn't close the child div. IE is rather prone to errors and will yield at you.

<divclass="content content_green"><divid="comments_section"></div></div>

Solution 3:

Use jQuery for this:

$("#comments_section").parent().hide()

Or, you could do this the right way:

$("div.content.content_green").hide()

Currently you don't use jquery. Visit jQuery documentation

Post a Comment for "Hide Parent Of Div"