Jquery check if checkbox checked
Somthing is wrong with this code.
I have div box and when click on Coutries title he shows the list of
countries. that list contain 5 check box
Germania
USA
Serbia
France
I have problem when i try to check if some countury checked..
searchContainer: function() {
var title = $(".title-search");
// On click show countury list
title.click(function(){
$(".state").fadeToggle('fast',function(){
// check if sothing checked
if ($("#france").is(':checked')) {
alert("France Selected");
// Show all cities from this countury
}
});
});
}
But when i check a country nothing happens....
First time i try this:
if($("#france").checked = true)) {
alert("FRANCE");
}
But when i click on title and when fadeToggle is done he show
alert(FRANCE) whitout checking.
And i try to use .length > 0 but nothing again. What i do wrong?
Thanks.
No comments:
Post a Comment