View Full Version : Using a one line function set to an onclick event.

08-30-2007, 03:14 AM
I figure this is possible somehow, my first thought was:

<input type="button" value="myBtn" onclick="javascript:function(){ myfunction1(); myfunction2(); }" />

That didn't work, but it didn't give me an error either ?????

Also do I need the "javascript:"?

Please critique away.

thanks in advance...

08-30-2007, 05:55 AM
Do you need the anonymous function?

I think you could just do...

<input type="button" value="myBtn" onclick="myfunction1(); myfunction2();" />

08-30-2007, 06:09 AM
.....thanks jgadbois....

that works perfectly...