How to Associate Methods by Using Button.

    0
    18
    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    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…



    Type Methods Details
    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:

    Type Event Handlers Details
    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

    Supported Environments:

    Javascript 1.0+ JScript 1.0+
    IE 3+ Opera3+
    Nav 2+ Chrome
    Mozila Mini opera

    image credit: http://www.dragonartz.net

    Don't miss out!
    Subscribe To Newsletter

    Receive top technical news, lesson ideas, travel tips and more!

    Invalid email address
    Give it a try. You can unsubscribe at any time.

    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here