Here I have number of checkboxes
whose structure are like parent and child.Here I can check only one checkbox based on parent,Suppose for Parent1
I checked Child11
again when I checked Child12
,Child11
should unchecked similar to radio button.
Again same thing should be happen for Parent2
,but if I check/uncheck
any child in Parent2
,children's of parent1
should not disturbed.
Can anyone please help me,here is the code below
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<div class="details">
<ul>
<li>Parent1</li>
<li>
<ul>
<li><input type="checkbox"><span>Child11</span></li>
<li><input type="checkbox"><span>Child12</span></li>
</ul>
</li>
</ul>
<ul>
<li>Parent2</li>
<li>
<ul>
<li><input type="checkbox"><span>Child21</span></li>
<li><input type="checkbox"><span>Child22</span></li>
<li><input type="checkbox"><span>Child23</span></li>
</ul>
</li>
</ul>
</div>
CSS
ul li{
list-style-type:none;
}