How to find No. of Elements Present in div?? also i want to print list of Element present in div . I have tried this but it is not working ..
<!DOCTYPE html>
<html>
<head>
<title> Div Length</title>
<script type="text/javascript" src="js/jquery-1.6.2.min.js">
</script>
<script>
$(function ()
{
alert(' Elements are ' +$('#main').length);
}
)
</script>
</head>
<body>
<div id="main">
<img src="images/thumb1.jpg"; height="30" width="30" />
<img src="images/thumb2.jpg"; height="30" width="30"/>
<img src="images/thumb3.jpg"; height="30" width="30"/>
<img src="images/thumb4.jpg"; height="30" width="30"/>
<div id="main1">
</div>
<div id="main2">
</div>
</div>
</body>
</html>
I need to find length because i am dynamical adding element in div from j query so at the end i want to check what are all elements that has been added successfully .
Thanks,