<table class="table lsttabl">
<thead>
<tr>
<th><div id="NameLabel">Customer Name</div></th>
<th>Email</th>
<th>Registered</th>
<th id="Date1Label">Created Date</th>
<th id="Date2Label">Last Updated Date</th>
<th id="Date3Label">Expiry Date</th>
<th id="UserCountLabel">User Count</th>
<th>Active</th>
<th>Configure</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
And I am trying to Bind Event using the code below
$("#NameLabel").click(function () { alert("hello"); });
I tried many variations but it is not working..
Please Share your knowledge.
IF this code is dynamically added after the page loads, you might need to use the delegate function.
Here I am using the
bodyselector as I can be sure that the body element was there when the page was loaded. If there is another parent element that you are loading the dynamic content into, you can use it instead of attaching the event to the body.