I need a way to determine if a returned object is a textarea (for example).
+7
A:
Try with:
$('selector').is('textarea');
Or:
alert($('selector')[0].type);
Sarfraz
2010-10-25 13:45:41
and with $("textarea.foo"), jquery will return only textarea's with the class "foo". It is no detection like the given answer, but a more precise way of selection
Justus Romijn
2010-10-25 13:48:13
@Justus Romijn: Sure it depends on selector specified.
Sarfraz
2010-10-25 13:49:19
@Sarfraz your answer is bulls-eye, I just wanted to point out that css-selection (which jQuery uses) is totally awesome :)
Justus Romijn
2010-10-25 14:12:04