I have a form with a variable amount of “select” dropdownlists and textboxes. I want to bind the .change() event to only the “select” elements. I’ve tried $(":input").change() but binds the .change() event to all the inputs. Is there something like $(":text") or a way to specify the $(":input") to only target “select” elements?
I have a form with a variable amount of select dropdownlists and textboxes. I
Share
The selector you pass to the
$()function can be any CSS selector, including just an html tagname such as “select”.Further reading: