I'm trying to use Jquery to toggle the class of the div with the element #house1, however no matter what I do it just doesn't seem to want to hide itself whenever I click on it.
This is the relevant html code together with the script:
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Cuprum' rel='stylesheet' type='text/css'>
<link href="bas.css" type="text/css" rel="stylesheet"/>
<meta charset="utf-8"/>
<title>Jans Fastigheter</title>
</head>
<body>
<div class="header">
<div>
<img src="jans_logo.jpg">
</div>
<ul>
<li><a class="current_huvud" href="Huvudsida.html">Huvudsida</a></li>
<li><a href="kontakta oss.html">Kontakta Oss</a></li>
</ul>
</div>
<div>
<div id="house1">
</div>
<div id="house2">
</div>
<div id="house3">
</div>
</div>
<script>
$(document).ready(function() {
$("#house1").click(function() {
$(this).toggleclass("hide");
});
});
</script>
</body>
</html>
And the relevant css code:
#house1 {
width:250px;
height:250px;
margin: 30px 30%;
background-image: url("apartment_building.jpg");
background-size: cover;
}
.hide {
display: none;
}