I am making a site and this code lets me have several pages in 1 .html file. Can the iterative-ness of this code be avoided? Can it be simplified?
<script type="text/javascript">
var x = 300;
$(function() {
$("#indexLink").click(function() {
$("#content>div").not("#start").hide(x);
$("#index").show(x);
$('nav>ul>li').removeClass('active');
$('#indexLink').addClass('active');
});
$("#leerlingLink").click(function() {
$("#content>div").not("#start").hide(x);
$("#leerling").show(x);
$('nav>ul>li').removeClass('active');
$('#leerlingLink').addClass('active');
});
$("#bestemmingLink").click(function() {
$("#content>div").not("#start").hide(x);
$("#bestemming").show(x);
$('nav>ul>li').removeClass('active');
$('#bestemmingLink').addClass('active');
});
$("#betalingLink").click(function() {
$("#content>div").not("#start").hide(x);
$("#betaling").show(x);
$('nav>ul>li').removeClass('active');
$('#betalingLink').addClass('active');
});
});
</script>