how to detect which button is clicked using jQuery

前端 未结 4 1098
青春惊慌失措
青春惊慌失措 2020-12-17 10:46

how to detect which button is clicked using jQuery

4条回答
  •  感情败类
    2020-12-17 11:05

    $(function() {
        $('input[type="button"]').click(function() { alert('You clicked button with ID:' + this.id); });
    });
    

提交回复
热议问题