jQuery find input type (but also for select)

后端 未结 2 1918
無奈伤痛
無奈伤痛 2021-02-03 21:31

I need to find the input type for radio buttons, text, and selects. Its easy to find the input type of anything with since $(this).at

2条回答
  •  轮回少年
    2021-02-03 22:16

    All types of input box and select box getting together by jQuery find :

    $('#myForm').find('select,input').each(function(i,box){
         alert($(box).attr('name'));
    }
    

提交回复
热议问题