How can JavaScript and applets communicate on a web page?
The technology for achieving this is called LiveConnect, and was first implemented by Netscape. It allows applets to call JavaScript methods, and vice versa. Unfortunately, it works in slightly different ways in the different browsers, and sometimes not at all. Mozilla.org has a test page, where you can test whether your browser supports LiveConnect. This page by Sun has examples of the newer