How would I determine whether the element returned by an :input filter in jQuery is a textbox or select list?
I want to have a different behavior for each ( textbox
You could do this:
if( ctrl[0].nodeName.toLowerCase() === 'input' ) { // it was an input }
or this, which is slower, but shorter and cleaner:
if( ctrl.is('input') ) { // it was an input }
If you want to be more specific, you can test the type:
if( ctrl.is('input:text') ) { // it was an input }