Get the ID by Class name JQuery

前端 未结 8 1905
臣服心动
臣服心动 2021-02-05 19:00

Hi this is a jquery question:

supposed i have this:





        
8条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-05 19:32

    Get ID using this way

    $(".select:checked").attr('id');
    

    Also keep in mind that if only one can be selected, it's better to change it to radio.

提交回复
热议问题