For example: <html> <head> <script> function foo() { alert("foo()"); } </script> </head> <body/> </html> I would like to write a Watir script that can call this function directly.