Page 1 of 1

have the "Onclick" button command perform multiple

Posted: May 28th, 2005, 8:46 am
by sgm
hey all,
i'm a bit new to scripting so i appologize in advance if this is a dumb question. I am trying to find out how to a button to perform multiple actions when it is clicked. As of right now, if i try and perform more then one function, the last function is the only one that is carried through

thanks
-sgm

Posted: May 28th, 2005, 11:22 am
by davestewart
Just nest the functions like so:

function fn1(){
alert('fn1')
}

function fn1(){
alert('fn2')
}

btn.onClick=function(){
fn1()
fn2()
}