---
title: "How to get the id of the checkbox that has just been checked by the user using jQuery?"  
description: "How to get the id of the checkbox that has just been checked by the user using jQuery?"  
author: "Anonymous User"  
published: 2014-08-25  
updated: 2014-08-25  
canonical: https://www.mindstick.com/forum/2117/how-to-get-the-id-of-the-checkbox-that-has-just-been-checked-by-the-user-using-jquery  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# How to get the id of the checkbox that has just been checked by the user using jQuery?

How to get the id of the [checkbox](https://www.mindstick.com/articles/291/how-should-use-checkbox-control-in-vb-dot-net) that has just been checked by the [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) using jQuery?

```
<div data-role="fieldcontain" style="margin: 0px">    <fieldset data-role="controlgroup">       
<asp:Repeater ID="rpt" runat="server">           
<ItemTemplate>               
<input type="checkbox" name="chkBox"                  
id="<%# DataBinder.Eval(Container.DataItem,
"[MemberId]").ToString() %>"                   
class="custom" /><label for="<%#
DataBinder.Eval(Container.DataItem, "[MemberId]").ToString()
%>"><%# DataBinder.Eval(Container.DataItem, "[LastName]").ToString()
%>,         <%#
DataBinder.Eval(Container.DataItem, "[FirstName]").ToString()
%></label>                           
           
</ItemTemplate>       
</asp:Repeater>    </fieldset></div>I have this jQuery function:$('input:checkbox[name=chkBox]').change(function () {                        var id =$(this).attr('id');            //var isChecked = $(this).attr('checked');               var isChecked = $('#'+id).is(':checked');     
});  
```

How do I get the id of the checkbox that has just been clicked and tell if it is checked or unchecked by the user as the [result](https://www.mindstick.com/blog/12011/advantages-of-getting-result-oriented-seo-from-an-agency) of the [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) [action](https://www.mindstick.com/forum/155752/what-is-action-result-with-its-types)?

Thanks

## Replies

### Reply by Sumit Kesarwani

Hi Ankit, \
try this:\

var isChecked = $(this).is(':checked');

var id = $(this).attr('id');


---

Original Source: https://www.mindstick.com/forum/2117/how-to-get-the-id-of-the-checkbox-that-has-just-been-checked-by-the-user-using-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
