Question: Here is my sql table

```
create table Poll_Question_Table (
PollQuestionId int primary key,
PollQuestionTex varchar(max),
PollStatus int ,
PollStartDate date,
PollEndDate date
)

```

i Want to change th status value from 1 to 0 if the current date pass the end date (dateline ) using function or trigger ..... tnx for ur help

Answer: 
Couple of issues in your code:

1) You are trying to append div inside table element. Which is not going to work. You need to append the div element either in td or have a separate container for modal.

2) Also you don't need to attach click event on each row after appending it. You need to use static parent element for event delegation. Which is table element in current case. Along with is start with attribute to target all row element starting with id `showModal`:

```
$('#indent_item_list').on('click','[id^=showModal]', function() {
  $('#modal'+this.id.replace('showModal','')).modal('show');
});

```

**[Working Demo](https://jsfiddle.net/9mbk7u79/)**
replace in your fiddle code

```
$('#showModal1').click(function() {

```

to new code

```
$(document).on('click', '[id^=showModal]', function() {

```