I have been using this to determine if an object is a “text” or not so I can get the .val or the checked state:
var val = object.is(":text") ? object.val() : object.is(":checked")
This works BUT now the object might also be:
- From a select
- From an input field
- From a checkbox
Is there another way I could code this so it would also work for a select?
The easiest way is to switch the logic around and take the
.val()if the object is not a checkbox.