title: Select only one checkbox in group
body: <p>I need in html select only one checkbox in a group.
  I find my example. But I can't realize it. It doesn't works.
  Here is my example: <a href="https://stackoverflow.com/questions/9709209/html-select-only-one-checkbox-in-a-group">example</a></p>
  
  <p>Here is my code HTML:</p>
  
  <pre><code>    &lt;div&gt;
              &lt;li&gt;
                  &lt;div class="radio"&gt;
                      &lt;label&gt;
                      &lt;input type="checkbox" name="mobil[1][]" id="optionsRadios1" value="1" checked class="radi"&gt;
                      Сотовый телефон имеется
                      &lt;/label&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;div class="radio"&gt;
                      &lt;label&gt;
                      &lt;input type="checkbox" name="mobil[1][]" id="optionsRadios2" value="0" class="radi"&gt;
                      Сотовый телефон не имеется
                      &lt;/label&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
      &lt;div&gt;
  </code></pre>
  
  <p>And code jquery:</p>
  
  <pre><code>$("input:checkbox").on('click', function() {
          // in the handler, 'this' refers to the box clicked on
          var $box = $(this);
          if ($box.is(":checked")) {
          // the name of the box is retrieved using the .attr() method
          // as it is assumed and expected to be immutable
          var group = "input:checkbox[name='" + $box.attr("name") + "']";
          // the checked state of the group/box on the other hand will change
          // and the current value is retrieved using .prop() method
          $(group).prop("checked", false);
          $box.prop("checked", true);
     } 
     else {
          $box.prop("checked", false);
     }
  });
  </code></pre>
  
  <p>Any help plz.</p>