hubpages profile image 84

How to call javascript function

asked by hubpages 6 months ago

flag

hathibelagal profile image

hathibelagal says

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()

 |  (+1 / -1)

You can vote each answer up or down to show your support or disapproval. You cannot flag an answer, but if an answer receives enough down votes compared to up votes, then it will become hidden.

working