Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Inner Div Using jQuery

Tags:

jquery

    <a href="#"> Link1  </a>  
    <div id="parent">
         <div id="child1">
                    Here is the Child One
         </div>
         <div id="child2">
                    Here is the Child Two
         </div>
    </div>

How can i hide child1 div using jquery ?

UPDATE

I want to hide child1 on click of Link1


1 Answers

$('div#parent > div#child1').hide(); 

Above for hiding direct child of #parent.

For Click

$('YOURLINK').on('click',function()
{
    $('div#parent > div#child1').hide();
});
like image 146
Dipesh Parmar Avatar answered Jul 14 '26 18:07

Dipesh Parmar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!