First there's the makeDoubleDelegate function to add the window.onload safely. But for most other elements, you can just do element.onclick = function_name. Remember NOT to use () for these assignments.