何select#category
を参照して、どれが要素 ID ですか? これも説明できselect option:selected
ますか?
$("select#category").change(function ()
{
if ($("select option:selected").val() == 0) {
$('div[id^="product_"]').hide();
$('#waiting').show();
}
$('#waiting').hide();
$('div[id^="product_"]').hide();
if ($('div[id="product_'+$("select option:selected").val()+'"]:visible'))
{
$('div[id="product_'+$("select option:selected").val()+'"]').show();
}
}
});
「id」が関係している場合、そこに select キーワードを配置するのはなぜですか?