JQuery:.change中的多个条件(function()

I was wondering if it is possible to have multiple conditions in a .change function.

For example, these are the two first lines of my .js file:

$(document).ready(function(){
     $("select[name=streettype]").change(function () {

This is for a page that deals with house values and such. I have a form where a user enters their address and "streettype" is a selection list of "rd", "st", "Ave", etc.

Say they select "st". Doing so will disable and enable some other options in the form.

Then as they continue filling out the form, there is another selection list. And they select "2 storey". Doing this should also enable and disable some other options and print some messages.

However, since the function only changes when "streettype" changes, selecting "2 storey" wont chaneg anything. Instead, the user will have to have "2 storey" selected, then go back and change "streettype" to something else (e.g. "rd") then back to "st" for it to change the other values further in the form.

So I am wondering if it is possible to have multiple conditions for change.

Thank you!

jQuery selectors work just like CSS selectors, so you could just do :

$("select[name=streettype],select[name=storey]").change(

and it will trigger for either of them.

Why do you even differentiate by name when you want them to share the same logic? I would add a class like this

<select name="streettype" class="listenChange">...</select>
<select name="storey" class="listenChange">...</select>

And then handle like so

$("select.listenChange").change(function(){
    var name $(this).attr("name"),
        newValue = $(this).val();
    switch (name) {
        case 'streettype':
            //..
            break;
        case 'storey':
            //..
            break;
    }
});
i think this may be work 

$("select[name=streettype1], select[name=streettype2]").change(function(){

});