I have two divs called "Yes" and "No"
<div id="object">
<div class="object-content">
I'd say
<div class="confirm" id="btnYes" runat ="server" >Yes</div>
</div>
<div class="object-content" style="float: right">
I'd say
<div class="confirm" style="color: red" id="btnNo" runat="server">No</div>
</div>
</div>
And one hidden input
<input type="hidden" id="hdnYesNoAnswer" value="" name="hdnYesNoAnswer" runat="server" />
And now When I click on the "Yes" div then "No" div will be disable and vice versa . And the clickable value will be assigned into hidden input value . Now problem is , when i click on the "No" div it does not change anything and the "yes" div did not disable . please anyone help me . I am trying the following code .
<script>
$(document).ready(function () {
if ($('#<%=btnYes.ClientID %>').click(function () {
$('#<%=btnYes.ClientID %>').html("Counted");
$('#<%=btnNo.ClientID %>').disable();
$('#<%=hdnYesNoAnswer.ClientID %>').val('1');
}));
else if($('#<%=btnNo.ClientID %>').click(function () {
$('#<%=btnNo.ClientID %>').html("counted");
$('#<%=btnYes.ClientID %>').disable();
$('#<%=hdnYesNoAnswer.ClientID %>').val('0');
}));
});
</script>