thanks again xelawho. The thing is, I want to have the code in the html right from the outset. for example, I'm looking at the "source.append" fragment which you can see by simply viewing the source html. I can simply add something like this to fire an action each time any node is clicked...
.on("click", alert('node has been clicked'));
But I want to be able to fire that action only for certain nodes (not every one), and for others I want to be able to fire different actions (or no actions at all). Hope I'm explaining that ok, but basically the problem is that I can't currently be node-specific.