Hey guys I'm new to jQuery and having a ton of trouble making things on my own. I'm trying to change the styling of to the css class .change, but it isn't working. Really need some help. Thanks in advance.
$(document).ready(function() {
$('#button').click(function() {
$(this).addClass('change');
})
})
html body {
margin:0;
padding:0;
background-color:#3366CC;
}
.main .container {
margin-top:0;
text-align:center;
padding:5%;
}
.main h1 {
color:white;
font-size:100px;
text-transform:uppercase;
}
.main h3 {
color:white;
font-size:50px;
}
.main #button {
color:white;
background-color:red;
padding:.5%;
text-align:center;
width:10%;
font-size:25px;
margin:auto;
}
.change {
background-color:black;
}
<DOCTYPE!html>
<html>
<head>
<title>Community-Help yours today</title>
<link rel='stylesheet' type='text/css' href='community.css'/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type='text/javascript' src='community.js'></script>
</head>
<body>
<div class="main">
<div class="container">
<h1>Community</h1>
<h3>Start an initiative, gain support, build your project</h3>
<div id="button">Get Started</div>
</div>
</div>
</body>
</html>