JQuery get the title of a button

前端 未结 8 1168
遇见更好的自我
遇见更好的自我 2020-12-30 18:33

I have a button:


Which makes this:

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 19:13

    Try

    $("button").click(function(){
    var title=$(this).attr("value");
    alert(title);
    });
    

提交回复
热议问题