Question: I need to get div id and its child class name by using div name . But div Id will be different and unique all the time. 

**HTML**

```
<div class="diagram" id="12" >
<div class="121">
    ...     
</div>
</div>

<div class="diagram" id="133" >
<div class="33">
    ...     
</div>
</div>

<div class="diagram" id="199" >
<div class="77">
    ...     
</div>
</div> So on..

```

JQUERY

```
$(function(){ 
//i need to pass  to values to the function in the following way

o.circle("12","121");
o.circle("133","33"); 
o.circle("199","77"); 

//So on..
});

```

Please help me out

Answer: 
```
$('div.diagram').each(function() {

  // this.id -> get the id of parent i.e div.diagram
  // $('div:first', this) -> get the first child of diagram, here this refers to diagram
  // $('div:first', this).attr('class') -> get the class name of child div

  o.circle(this.id, $('div:first', this).attr('class'));
});

```

If you want to try this on any event, then try:

example:

```
// I assumed a click event

$('div.diagram').on('click', function() {
  o.circle(this.id, $('div:first', this).attr('class'));
});

```
You can use this.It is working fine for me.

```
                 $('div.diagram').on('event_name', function() { // use click, hover, change, focus at the place of event_name whatever you need
                   o.circle(this.id, $('div:first', this).attr('class'));
                 });

```