JSFiddle - React, Tailwind, and code Playground

by rajaadil

HTML

<input name="" type="checkbox" value="here"/>(if this was checked)
<input name="" type="checkbox" value="here"/>(then this)
<input name="" type="checkbox" value="there"/>(would not allow prompt alert) 
<input name="" type="checkbox" value="here"/>(would allow)

JavaScript

$('input[type=checkbox]').change(function() {
    if($(this).is(':checked'))
    {
       if ($(this).val() == $(this).prev().val()) alert("previous checkbox has same value");
    }
});