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?

Thanks
You should be doing:
So it would be:
var comments = []; $("textarea.comment_wide_textbox_control").each(function() { comments.push($(this).attr("id"), $(this).val()); });