Question: I want to hide a div with jQuery... 

But i am confused that what is the best way to do this? 

1. I can hide the div by changing its css display property to none. 

```
$("#header-link1").click(function(){
  $("#header2").css({
    'display': 'none'
  });
}

```

or,
2. I can do the same thing with jQuery hide() function. 

```
$("#header-link1").click(function(){
  $("#header2").hide();
}

```

Any suggestions what is the best way and why?

Answer: 
**You should use method 2** since if you want to `show()` it again, it will take care of setting the `display` to the correct value, meaning `inline` for inline elements and `block` for block elements, whereas if you use method 1 you will have to choose for yourself what is the correct `display` even tho' usually it is `block`.
If you look at the jQuery API for .hide() (<http://api.jquery.com/hide/>) you will notice that .hide() utilizes the css display attribute as its method to hide a page element. Thus, they serve the exact same purpose, but one is just a bit cleaner.

I personally would go with $("#div").hide() because it is much cleaner and keeps your code that much shorter.