Having a hard time attaching a click event. I just want to do a few calculations when user checks a checkbox. When a checkbox is checked the span's class becomes 'checked' & 'unchecked' when unchecked. The input checkbox is not displayed & also its attribute 'checked' is not applied, when checked, making it even more difficult.
HTML:
<div class="checkboxBtn" style="border:1px solid blue;">
<span class="cheked" style="width:20px;height:20px;border:1px solid red;"
onclick="CheckSelected();">
</span>
<input id="23" type="checkbox" style="border:1px solid green;"></input>
<label>Compare Now</label>
</div>
None of these worked:
JS:
$(document).ready(function () {
$(".cheked").click(function () {
alert(".cheked");
})
$(".uncheked").click(function () {
alert(".uncheked");
})
})
function CheckSelected() {
alert("");
return false;
}

Is this not working because, there might be already a click event to show the tick image. If there is any already, how can I do my task, without disturbing the existing functionality.