In my last post https://www.techtravelhub.com/2012/11/how-to-create-button-in-web.html I have shown how a button is created in web page.
In this post I will write how to insert or triggers method by using button.
let us check what are the methods a button supports…
|Methods||blur()||It removes the focus from a button|
|click()||Most commonly used method with button. It calls the event handler function defined by developer|
|focus()||This is a method triggered when a button gains focus|
|handleEvent()||This throws an event to correct event handler|
let us also check the Event handlers associated with a button:
|Event Handlers||onBlur||This event occurs when focus is removed from a button. This handler got activated|
|onClick||This event occurs when user clicks on a button. This handler got activated|
|onFocus||This event occurs when a button gain focus.This handler got activated|
|onMouseDown||This is similar to click but only activated when a mouse click is done.This handler got activated.Mostly used secure website where mouse click is allowed|
|onMouseUp||This is similar to click but only activated when a mouse click is done to deselect a button.This handler got activated.Mostly used secure website where mouse click is allowed|
image credit: http://www.dragonartz.net