How to get input type using jquery?

后端 未结 11 1816
猫巷女王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:49

    It would seem that the attr functionality is getting further deprecated

    $(this).attr('TYPE')
    undefined
    $(this).prop('type')
    "text"
    

提交回复
热议问题