0

2 つのドロップダウン選択があります。1 つは Disciplines と呼ばれ、もう 1 つは MensLevels と呼ばれます。どちらも最初の選択の値に基づいて同じ ID を共有します。2 番目の選択を非表示にするにはどうすればよいですか? ここに私のコードがあります:

    $("select[name=Disciplines]").change(function() {
        if ($(this).val() == 'Acro') {
                var PID = $(this).attr('id');
                $('td:nth-child(6).attr("id") == "' + PID + '"').hide(); 
            }
    });
4

2 に答える 2

1
$("select[name=Disciplines]").change(function () {
    if ($(this).val() == 'Acro') {
        $('select[name=MensLevels][id="' + this.id + '"]').hide();
    }
});
于 2013-05-08T14:44:50.197 に答える