Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery check if checkbox checked
    primarykey
    data
    text
    <p>Somthing is wrong with this code.</p> <p>I have div box and when click on Coutries title he shows the list of countries. that list contain 5 check box</p> <ul> <li>Germania</li> <li>USA</li> <li>Serbia</li> <li>France</li> </ul> <p>Fiddle <a href="http://jsfiddle.net/ikac/bfaH5/" rel="nofollow">http://jsfiddle.net/ikac/bfaH5/</a></p> <p>I have problem when i try to check if some countury checked..</p> <pre><code> 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 } }); }); } </code></pre> <p>But when i check a country nothing happens....</p> <p>First time i try this:</p> <pre><code>if($("#france").checked = true)) { alert("FRANCE"); } </code></pre> <p>But when i click on title and when fadeToggle is done he show alert(FRANCE) whitout checking.</p> <p><strong>HTML :</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="javascript/gfactory.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="css/gfactory.css"&gt; &lt;script&gt; $(document).ready(function() { window.Balcanrent.init(); window.Balcanrent.searchContainer(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="search"&gt; &lt;div class="search-box"&gt; &lt;div class="title-search"&gt; Counturies &lt;/div&gt; &lt;div class="state"&gt; &lt;ul class="s_list"&gt; &lt;li&gt;&lt;input id="ger" type="checkbox" value="gr"&gt;Germania&lt;/li&gt; &lt;li&gt;&lt;input id="usa" type="checkbox" value="usa"&gt;USA&lt;/li&gt; &lt;li&gt;&lt;input id="sr" type="checkbox" value="sl"&gt; Serbia &lt;/li&gt; &lt;li&gt;&lt;input id="france" type="checkbox" value="fr"&gt;France &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And i try to use .length > 0 but nothing again. What i do wrong?</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload