I have a javascript function that receives a dom element as a parameter. In this function I am trying to get to the closest ancestor 'form'. I wanted to use: 

```
function submit_form(obj)
{
    var form1 = $(obj).closest("form");
    alert (form1.id);
}

```

here obj is a dom element of submit type. I just don't seem to get it working.  

Could someone please help?