I'm going nuts over an issue I'm sure is obvious to someone.
I want a certain section of my page to disappear when a button is clicked.
Here's my code:
$(document).ready(function(){
$('.button').click(function() {
$('.page-section').css('display', 'none');
});
});
The script is being referenced correctly. jQuery is being loaded first. If I put an alert('something') inside the click event, it fires.
But for some reason, I am unable to get the css to change.
When I use the same line of code in my console, the css changes as it should.
Any ideas?
.page-sectionis the correct onecss()you can use$('.page-section').hide().buttonis causing a page reload