I want to get the child div of main div
<div class="test">
<div id="dog"></div>
<div id="cat"></div>
<div id="drig"></div>
</div>
</p>
var a= $("div.test #dog");
alert (a);
var b= $("div.test #abc");
alert (b);
The problem is both a
and b
are returning the [object object]
. where as there is no child id abc
JS Fiddle http://jsfiddle.net/8yJNS/