Your HTML defines lightBtn
and darkBtn
as classes (.
) of your label elements, while your jQuery is targeting elements with the ID's lightBtn
and darkBtn
(#
).
Change them to be the same, e.g:
$( function() {
$('.lightBtn').click( function() {
$('body').css('background', 'white' );
});
$('.darkBtn').click( function() {
$('body').css('background', 'black' );
});
});
Or just change your HTML labels to be defined like:
<label id="lightBtn" class="btn btn-default">
...
<label id="darkBtn" class="btn btn-default">
...