what's wrong with my code, I don't get any values:
<script> $(document).ready(function() { $("input[type=checkbox][checked]").each(function(event){ var get = $("input[@name=\'checkbox_pref\']:checked").val(); $("#result").html("&id=" + get); }); }); </script> </head> <body> <input type="checkbox" name="checkbox_pref" value = "1"/> <input type="checkbox" name="checkbox_pref" value = "2"/> <input type="checkbox" name="checkbox_pref" value = "3"/> <div id="result">result ...</div>