How to get input type using jquery?

后端 未结 11 1848
猫巷女王i
猫巷女王i 2020-11-28 02:17

I have a page where the input type always varies, and I need to get the values depending on the input type. So if the type is a radio, I need to get which is checked, and if

11条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 02:33

    You could do the following:

    var inputType = $('#inputid').attr('type');
    

提交回复
热议问题