<html> <head> <title>Test</title> <script type="text/javascript"> function Test(elem){ elem.innerHTML = "ok"; } </script> </head> <body> <div id="a1" onclick="Test(this)">click</div> </body> </html>