<html> <head> <script> var id_name_func= '0'; function my_func0(text) { alert(text); } </script> </head> <body> <input type="button" value="Call" onclick="*!*window['my_func'+id_name_func]('text');*/!*" /> </body> </html>