function printClassForAllDivs()
{
var divs = $('div');
divs.each(function{
var klass = $(this).attr('class');
console.log('div class = '+klass);
});
}
このコードはすべてのdivをループする必要があり、ループの反復ごとに、クラスを格納する変数を作成して、コンソールに出力する必要があるように思われます。
匿名関数の使い方がわからないのではないかと思います。
function printClassForAllDivs()
{
var divs = $('div');
divs.each(function{
// what don't I understand about what I am permitted to do in here?
});
}
ありがとう。