<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<style>
#wrapper{
background: red;
}
</style>
</head>
<body>
<div id="wrapper">
<div class="red">
<input type="checkbox" name="switch" id="switch">
<label class="switch" for="switch"><!--<span></span>--></label>
</div>
</div>
<script>
$(function() {
var x = $('#wrapper').css('background');
var y = $('#wrapper > div').css('background');
$('#wrapper > div').on('click', function() {
$('#wrapper').css('background') == x ? $('#wrapper').css('background', y) : $('#wrapper').css('background', x);
});
});
</script>
</body>
</HTML>