leora
leora

Reputation: 196449

Showing a Hidden DIV with jQuery

I have a div that starts out hidden:

<div id='deskView' style="display: none;">

How can i make it visible using jQuery on a button click?

Upvotes: 0

Views: 216

Answers (5)

s3yfullah
s3yfullah

Reputation: 165

<input type="button" value="Click" id="Button1" onClick="$('#deskView').show()" />

Upvotes: 0

artlung
artlung

Reputation: 34013

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){

  $('#myButton').click(function(){
    $('#deskView').show();
  });

});
</script>

<div id="deskView" style="display: none;">
  desk  view
</div>

<input type="button" value="Click Me" id="myButton" />

Go through the Tutorials -- it's worth it.

Upvotes: 0

rATRIJS
rATRIJS

Reputation: 309

$('#button_id').click(function() {
  $('#deskView').show();
});

Anyway - this is a good place to look for further information: http://docs.jquery.com/Main_Page

Upvotes: 1

dnagirl
dnagirl

Reputation: 20456

$('#deskview').show();

Upvotes: 1

jpabluz
jpabluz

Reputation: 1312

You can look at the API.

http://api.jquery.com/show/

Upvotes: 1

Related Questions