mercredi 10 janvier 2018

checkbox used in li tag jquery

i want to checked checkbox when click on li then all the checkbox is check on that li tag if i click on another li then checked all checkbox but other li checkbox is unchecked, its make as radio system. how this is possible. code.

jQuery(function($) {

});
.btn {
  background-color: gray;
  font-size: 15px;
  font-weight: bold;
  font-family: sans-serif;
  border: 1px solid black;
  height: 20%;
}
<script src="http://ift.tt/1oMJErh"></script>

<ul>
  <li class="btn checkall">
    <input type="checkbox" name="offer[key1]" class="check_one">
    <input type="checkbox" name="offer[key2]" class="check_one">
    <input type="checkbox" name="offer[key3]" class="check_one">
    <input type="checkbox" name="offer[key4]" class="check_one">
  </li>
  <li class="btn checkall">
    <input type="checkbox" name="offer[key1]" class="check_one">
    <input type="checkbox" name="offer[key2]" class="check_one">
    <input type="checkbox" name="offer[key3]" class="check_one">
    <input type="checkbox" name="offer[key4]" class="check_one">
  </li>
  <li class="btn checkall">
    <input type="checkbox" name="offer[key1]" class="check_one">
    <input type="checkbox" name="offer[key2]" class="check_one">
    <input type="checkbox" name="offer[key3]" class="check_one">
    <input type="checkbox" name="offer[key4]" class="check_one">
  </li>
  <li class="btn checkall">
    <input type="checkbox" name="offer[key1]" class="check_one">
    <input type="checkbox" name="offer[key2]" class="check_one">
    <input type="checkbox" name="offer[key3]" class="check_one">
    <input type="checkbox" name="offer[key4]" class="check_one">
  </li>
</ul>



Aucun commentaire:

Enregistrer un commentaire