I have the piece of html below. The table is used for JQgrid.

```
<section id="section_students">
<table id="grid_students"></table>
<a class="btn" href="#">Click</a>
</section>

```

And I'm intending to use JQuery to find out the value of the table if a button under the same section is clicked.

```
$("section a.btn").click(function(){
var curGrid = $(this).parent().find('table').get(0);
alert($(curGrid).attr("id"));
});

```

This alert will return 'undefined' and I can't understand why.  

What am I missing?

EDIT: Looks like JQGrid changes the ID of the table, which is weird. I'll be researching this, meanwhile, if anyone knows how to prevent this behavior, please let me know.