hi,
now i get value if i selected checkbox(id which was selected),
but how get value when i unselected (id which was unselected)?

For example I push on 1, and i get value 1. When I unselect 1, i get value 1.
I hope you understand my problem.

<script>
$(document).ready(function()
{
    $("input[type=checkbox]").change(function(event){
        $("#result").html("&id=" + this.value);
    });
});
</script>
</head>                                                                 
<body>                                                                
<input type="checkbox" name="checkbox_pref" value = "1"/>1
<input type="checkbox" name="checkbox_pref" value = "2"/>2
<input type="checkbox" name="checkbox_pref" value = "3"/>3 
<div id="result">result ...</div>

this.value just returns the value attribute, whether or not the checkbox is checked. See this post how you can read if it is checked or not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.