get id of button by clicked with function – Jquery ajax
html <button id="test1" onclick="getclickname(); return false;">click</button> javascript (it's showing "Undefined") function getclickname() { alert(this.id); } i dont want code like this <button id="test1" onclick="alert(this.id);">click</button> call getclickname is needed, thanks guys