CopyPastor

Detecting plagiarism made easy.

Score: 1.579762041568756; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2019-06-04
by Turing1729

Original Post

Original - Posted on 2013-09-25
by letiagoalves



            
Present in both answers; Present only in the new answer; Present only in the old answer;

**HTML**

<div class="pricing-levels-2"> <p><strong>Sample Examle</strong></p> <input class="single-checkbox"type="checkbox" name="sample" value="val">Level 1<br> <input class="single-checkbox" type="checkbox" name="sample" value="val">Level 2<br> <input class="single-checkbox" type="checkbox" name="sample" value="val">Level 3<br> <input class="single-checkbox" type="checkbox" name="sample" value="val">Level 4<br> </div>
**SCRIPT**
var limit = 2; $('input.single-checkbox').on('change', function(evt) { if($(this).siblings(':checked').length >= limit) { this.checked = false; } });
[Check the Live Demo Here][1]

[1]: http://jsfiddle.net/Ashok_knv/wbvoz2ar/6/
Using `change` event you can do something like this:
var limit = 3; $('input.single-checkbox').on('change', function(evt) { if($(this).siblings(':checked').length >= limit) { this.checked = false; } });
[**See this working demo**][1]

[1]: http://jsfiddle.net/vVxM2/

        
Present in both answers; Present only in the new answer; Present only in the old answer;