0

I have this code:

parent.find('input, select, textarea').each(function () {
        console.log($(this));           
});

I want to know if $(this) is text / checkbox / radio / select / textarea

How can I achieve that?

Any help is appreciated

Jack
  • 7,433
  • 22
  • 63
  • 107

1 Answers1

1

Have you tried is?

parent.find('input, select, textarea').each(function () {
        if($(this).is('input')){
          console.log('Input it is');           
        } 
        ...            
});

http://api.jquery.com/is/

Beri
  • 11,470
  • 4
  • 35
  • 57