Mendel Yaffe Mendel Yaffe - 5 months ago 7x
Javascript Question

How can I get this code to change the background color every other click?

The div tag referred to is the only code that I added to the HTML text. If possible please provide your answer in just jquery.
$("div").click(funcOne(), funcTwo());

$.funcOne = function(x) {document.getElementsByTagName("div").style.backgroundColor = "blue";};

$.funcTwo = function(x) { document.getElementsByTagName("div").style.backgroundColor = "red";};

$('div').click(function(){ = === 'blue' ? 'red' : 'blue'