I have the below code which shows/hides a div based on an option in a dropdown, however it only toggles when a user selects 1. There are a few items in my dropdown that I'd like to show the DIV for. For example, let's say I have values 1 through 8 in my dropdown, and I want to show a DIV when a user has selected 4, 6, and 7. I don't want the DIV to toggle off and hide if a user changes selection from 4 to 6 either.
$(document).ready(function(){
$('#TypeofAction').on('change', function() {
if ( this.value == '1')
//.....................^.......
{
$("#business").show();
}
else
{
$("#business").hide();
}
});
});
||developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…