id.onclick=function()

This example uses id.onclick=function() method to attach a click event to a button.