Jquery,找到选择器的类型 - howto?

yos*_*ssi 2 jquery detection object-type

我需要一种方法来确定返回的对象是否是textarea(例如).

Sar*_*raz 7

试试:

$('selector').is('textarea');
Run Code Online (Sandbox Code Playgroud)

要么:

alert($('selector')[0].type);
Run Code Online (Sandbox Code Playgroud)