<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<input type="checkbox" class="geceModu">
<hr>
<img src="https://cdn4.iconfinder.com/data/icons/flat-brand-logo-2/512/apple-512.png" class="logo" alt="Logo" width="150px">
<div class="urun">içerik</div>
.urun {
    background:#fff;
    color:#000;
    width:150px;
    height:150px;
}
.night {
    background:#000 !important;
    color:#fff !important;
}
    $(document).ready(function(){
        $(".geceModu").click(function(){
            var siyah = 'https://cdn4.iconfinder.com/data/icons/flat-brand-logo-2/512/apple-512.png';
            var beyaz = 'https://cdn1.iconfinder.com/data/icons/smallicons-logotypes/32/apple-512.png';
            if ($('.logo').attr('src') === beyaz) {
                $('.logo').attr('src', siyah);
            } else {
                $('.logo').attr('src', beyaz)
            }
            $(".urun").toggleClass("night");
        });
    });

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.