jQuery onClick capture the id of the element

后端 未结 6 1075
借酒劲吻你
借酒劲吻你 2020-12-29 20:26

i have many input fields like this

 

when i click this rad

6条回答
  •  情话喂你
    2020-12-29 21:04

    pass this to the function

    enableTxt(this)
    
    function enableTxt(item) {
        var id = $(item).attr("id");
        alert(id);
    }
    

提交回复
热议问题