how to detect which button is clicked using jQuery

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

how to detect which button is clicked using jQuery

4条回答
  •  既然无缘
    2020-12-17 11:10

    Since the block is added dynamically you could try:

    jQuery( document).delegate( "#dCalc input[type='button']", "click",
        function(e){
        var inputId = this.id;
        console.log( inputId );
        }
    );
    

    demo http://jsfiddle.net/yDNWc/

提交回复
热议问题