Struggling to make this jQuery function properly. I have a form with all fields contained in a div.form-group
. The subscribe button is identified by the id subscribe
.
I'm aiming to hide the form fields when clicked, but my JavaScript doesn't seem to be cooperating. Below is what I've attempted without success:
(function($) {
window.onload = function () {
$("#subscribe").click(function() {
$(".form-group").css("display: none");
});
}
})(jQuery);
The CSS for the form-group
class specifies display: block
.
Am I overlooking something obvious? Any assistance would be greatly appreciated.
Cheers,