I持っ以下:それぞれ固有の情報私はこれらのいずれかのボタンがあるときになるようにそれを作るしようとしている取得値
<div class="button">
<div id="first">
Johny
</div>
<div id="second">
Dog
</div>
<div id="third">
Pasta
</div>
</div>
<div class="button">
<div id="first">
Bob
</div>
<div id="second">
Cat
</div>
<div id="third">
Noodles
</div>
</div>
.
.
.
を持っているボタンのdivのの束私は内側のdivの値をチェックすることができます。例えば
$('.button').on('click', function() {
// Check to see if the text of the 'first' div is
// johnny or bob or something else
});
'$(this).children()'はあなたに現在のdivのすべての子を与えます。これで、その配列を反復してテキストを取得できます –