<!-- Try these: Try puttin a semicolon(";") infront of the function name: onclick="my_func();" Check for any errors in the console(Ctrl + Shift + J) Use JQuery instead of onload event. -->