入力から値を取得しようとしています。値 = 1,2,3 ... の場合はコンテンツを表示し、それ以外の場合は値 = 4,5,6 ... 他のコンテンツを表示します。私はほとんどそれが機能していましたが、何かが壊れました。私はこれで何年も遊んできました。誰かが簡単に見て、私がそれを壊した場所を教えてくれませんか。
var amount = $(".quantity-wrapper > .input-text").val();
if(amount = '1') {
$('.product-addon-one-attendee').show();
}
if(amount = '2'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
}
if(amount = '3'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
}
if(amount = '4'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
}
if(amount = '5'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
}
if(amount = '6'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
$('.product-addon-six-attendees').show();
}
if(amount = '7'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
$('.product-addon-six-attendees').show();
$('.product-addon-seven-attendees').show();
}
if(amount = '8'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
$('.product-addon-six-attendees').show();
$('.product-addon-seven-attendees').show();
$('.product-addon-eight-attendees').show();
}
if(amount = '9'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
$('.product-addon-six-attendees').show();
$('.product-addon-seven-attendees').show();
$('.product-addon-eight-attendees').show();
$('.product-addon-nine-attendees').show();
}
if(amount = '10'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
$('.product-addon-six-attendees').show();
$('.product-addon-seven-attendees').show();
$('.product-addon-eight-attendees').show();
$('.product-addon-nine-attendees').show();
$('.product-addon-ten-attendees').show();
}
if(amount = '11'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
$('.product-addon-six-attendees').show();
$('.product-addon-seven-attendees').show();
$('.product-addon-eight-attendees').show();
$('.product-addon-nine-attendees').show();
$('.product-addon-ten-attendees').show();
$('.product-addon-eleven-attendees').show();
}
if(amount = '12'){
$('.product-addon-one-attendee').show();
$('.product-addon-two-attendees').show();
$('.product-addon-three-attendees').show();
$('.product-addon-four-attendees').show();
$('.product-addon-five-attendees').show();
$('.product-addon-six-attendees').show();
$('.product-addon-seven-attendees').show();
$('.product-addon-eight-attendees').show();
$('.product-addon-nine-attendees').show();
$('.product-addon-ten-attendees').show();
$('.product-addon-eleven-attendees').show();
$('.product-addon-twelve-attendees').show();
}