How can I let an javascript in an frame work, by clicking the button in another frame?

like:
PHP Code:
<a href="function();" target="main"
or so?

thx!