I am trying to add id of an element to an array. But I am getting the error - Microsoft JScript runtime error: Object doesn't support this property or method.
Below image shows how I am adding the id value to array. Also why is value of $(this).id undefined?

![enter image description here](https://i.stack.imgur.com/EW8eb.png)

Thanks