How to call javascript function

  1. HubPages profile image
    97
    HubPagesposted 8 years ago

    How to call javascript function

  2. hathibelagal profile image74
    hathibelagalposted 8 years ago

    Let us assume, your javascript function is defined as :
    function test() { ... }

    You can call this function in the following ways:
    1) As as event handler, as in,
        onclick="test();"     
    2) Called directly inside a script tag, as in,
        test()
    3) On click of a hyperlink, as in,
        javascript:test()

 
working