Since the jQuery .toggle event method is deprecated. What are we suppose to use to simulate this event (alternate clicks)?
var i = 0; $('button').click(function() { if (i == 0){ $('div').css({background: 'red'}) i++; } else { $('div').css({background: 'yellow'}) i = 0; } });