What's the typical way for PS use in an onclick handler?
The code you used will produce working JavaScript, but the answer to the particular question about onclick handlers is "don't." It's better to set up event handling in JavaScript: http://stackoverflow.com/questions/5871640/why-is-using-onclick-in-html-a-ba...
I haven't tried https://github.com/petermichaux/evento but Peter Michaux's previous JS event libraries have been nice.
If you want to specify onclick handlers in HTML, having onclick="foo();" and defining foo later is the neatest way to do it.
Vladimir