Search code examples
jquerydetectionobject-type

Jquery, finding the type of a selector - howto?


I need a way to determine if a returned object is a textarea (for example).


Solution

  • Try with:

    $('selector').is('textarea');
    

    Or:

    alert($('selector')[0].type);