Q:

Moving div right and left on click

I want to make div go left the first time i click on it, back to its original position the second time, left again the third etc..
So why isn't this working:
http://jsfiddle.net/kS7KE/2/
    var checker = new Boolean();
checker = true;
if (checker = true){
    $("#div").click(function () {   
        $(this).animate({left: "10%"},400);   
        checker = false;
    });
}
if (checker != true){
    $("#div").click(function () {   
        $(this).animate({left: "30%"},400);   
        checker = true;
    });
}

A:

Why so much code ? :)
var checker = true;
$("#div").click(function () {
    targetLeft = checker ? "10%" : "30%";
    $(this).animate({left: targetLeft},400);   
    checker ? checker = false : checker = true;
});

http://jsfiddle.net/kS7KE/5/

A:

A few issues:

if (checker = true)
You are using an assignment (=) rather than a check for equality (== or ===).
Your check happens at bind time
You want to check checker in your click event. 

Soemthing like this will do the trick:
var checker = new Boolean();
checker = true;
$("#div").click(function () { 
    var left = checker ? "10%" : "30%";
    $(this).animate({left: left},400);   
    checker = !checker;
});

http://jsfiddle.net/lbstr/L4TN3/

A:

First, don't use new Boolean().  Just initialize it like var checker = true;
Second, you're using an assignment operator in your first conditional (checker = true).
Third, you're not executing the conditional on each click.
Fourth, your code is pretty convoluted. Here's a sample:
var checker = true;
$('#div').click(function() {
    $(this).animate({
        left: checker ? "10%" : "30%"
    });
    checker = !checker;
});

