You should use the following:
$(function() {
$("div.container").each( function(){
alert( "test" );
});
});
There is a big difference between $. each and .each .
The first method is a generic iterator function that is used to iterate over arrays and objects, where the last method is used to cycle through a set of jQuery objects.
$.each('div.container'), , . div.container 13 (, 13) , 13 (. ).