Check box with jQuery
<p>Here is the jsfiddle <a href="http://jsfiddle.net/6mk7m/9/" rel="nofollow">http://jsfiddle.net/6mk7m/9/</a></p>

<p>I have found out on stackoverflow that I need to make jsfiddle account so I can show you guys the code for easy reading, ( sorry guys ) if my English is a not so good, </p>

<p>I am currently learning jQuery, I am not an expert, just a " beginner " ,anyway,</p>

<p>I have made a checkbox and I gave it an id = all </p>

<pre><code>&lt;input type="checkbox" id="all" /&gt;&lt;span style='color:red'&gt;All&lt;/span&gt;
</code></pre>

<p>Simply what i want is, when i click on this checkbox with this specific <strong>id = all</strong> i want to check these 3 checkboxes listed below </p>

<pre><code>&lt;input type="checkbox" name="us[]" value="google" /&gt;Google
&lt;input type="checkbox" name="us[]" value="youtube" /&gt;Youtube
&lt;input type="checkbox" name="us[]" value="friend" /&gt;Friend&lt;br/&gt;&lt;br/&gt;
</code></pre>

<p>so this is the code that I some how figured out, </p>

<pre><code>&lt;script type="text/javascript"&gt;

$("document").ready(function() {


    $("input[id='all']").bind('click',function(){

        var all = $(this);

        console.log('status: ' + all.prop('checked'));


        if(all.prop('checked') == true)
        {
            //alert('now its true');
            $("input:checkbox").attr("checked","checked");
        }
        else if (all.prop('checked') == false){
            $("input:checkbox").removeAttr("checked");
        }

    })
})  
 &lt;/script&gt;
</code></pre>

<p>when i click on the checkbox with id = all ( <strong>it selects all checkboxes</strong> ) </p>

<p>now when i click the second time on the checkbox with id = all ( <strong>it unchecked all checkboxes</strong> ) </p>

<p><em><strong>every thing is greet untill now</em></strong></p>

<p>Now the problem when i go to click a third time on the checkbox with id = all</p>

<p>( <strong>it dose not check any checkboxes</strong> )
However when i check the console i see all attributes equal to checked - but the checkboxes i don't see them checked on the browser i mean the checkboxes they dont have this <strong>tick</strong> mark in the middle of each box,
maybe there is something wrong with code, i just can't figure it out why it's not working when i want to click more than 3 times, 
so please guys some with this crazy thing ;) ---- thanks in advanced ;)</p>
