You need to read up on the concepts behind AJAX. Getting a value from a database has nothing to do with JS.
One approach is to use ASP.NET WebMethods and a ScriptManager to link your codebehind (Where you have DB access) to your JS on the client side.
http://www.xdevsoftware.com/blog/post/Call-WebMethod-from-Javascript-in-ASPNET.aspx
This way your javascript calls a method in your codebehind that looks up the value and returns it to your javascript which will then use jQuery to show/hide a div for you.
Javascript (ask for show/hide status) -> Webmethod (ASP.NET DB Lookup) -> Javascript (show hide with jquery based on result)