这段jQuery 怎么实现不了 全选/全不选/反选的功能?

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<input type="checkbox" name="" id="" checked="true" >吃
<input type="checkbox" name="" id="" >喝
<input type="checkbox" name="" id="" >嫖
<input type="checkbox" name="" id="" >赌
<input type="button" id="all" value="全选">
<input type="button" id="allnot" value="全不选">
<input type="button" id="ss" value="反选">

<script>
// alert($('#aa').attr('checked'));

$('#all').click(function(){
$('input').attr('checked','true')
});

$('#allnot').click(function(){
$('input').attr('checked','false');
// $('input').removeAttr('checked');
});

$('#ss').click(function(){

$('input[type="checkbox"]').each(function(){
$('this').attr('checked',!$(this).attr('checked'));
});
});

</script>
</body>
</html>

这段代码 调试很长时间 怎么实现不了 全选/全不选/反选的功能;
求大神解答一下。
$('#all').click(function() {
$('input[type="checkbox"埋扒]').prop('checked', true );
});

$('#allnot').click(function() {
$('input[type="液誉checkbox"]').prop('checked', false );
});

$('#ss').click(function() {
var checked = $('input[type="checkbox"]:checked');
var unchecked = $('input[type="checkbox"]:not(:checked)');
checked.prop('checked'闹液段, false );
unchecked.prop('checked', true );
});