You didn't succeed because of following reasons:
- You didn't include the jQuery in your example file.
- You have a class called
quick-links-container
in your HTML but in your JS you are using #quick-links-container
which returns an ID. So that needs to be changed to '.quick-links-container'
- You are using only
show()
on click therefore on click the div will always be set to show, instead you can use toggle()
to toggle the visibility of the div.
So, your javascript code needs to be modified to following:
$('.quicklinks-button').click(function(){ $('.quick-links-container').toggle();});
jsFiddle: http://jsfiddle.net/GautamChadha/U5Rwg/