Add event to specific button

This is my code.

How do I target the eventhandler to fire from just on a specific button.

I Have tried just about everything I know, and either the toolbar disappears or it does not work.


you can check the item id before calling function. In this case it will be called only for a certain item. For example:

toolbar.attachEvent(“onClick”, function(id){

if(id ==‘delete’) alert(“Button “+id+” was clicked”);