You cannot handle the ok button by using an event handler.
However, you can still capture the ok button's click event by using code in Javascript.
Here is an example -
var r = confirm("Press a button");
if (r==true)
{
x="You pressed OK!";
}
else
{
x="You pressed Cancel!";
}