I want to add css that will change every time I click. But I couldn't find anything like this in jquery. How can I do this using jquery?
I want you to click on the background color every time. I know how to do this with toggleClass. But I want to do by adding css. The background turns red when the button is clicked. I want it to change when clicked again. I have to do this using .css, not ToggleClass.
$(function() {
var a = 0;
$('.mob-channel-title').click(function() {
$(".content").css("background", "red");
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="mob-channel-title">Click me</div>
<div class="content">Content here</div>