sign in


Forgot your password?


Why sign up?
- One account for five websites!
- Free access to Premium Codes
- Acess to cool web tools
- Ask and answer questions
- Stay ahead of other web developers
- and MUCH MORE!

Feel The Power

Html Codes: Canvas- Make Graphical Buttons by a Function

When HTML5 Canvas element is used, there is no way to define HTML standard form elements; so if you need a button you can not create it easily. The following code is a function for creating buttons inside HTML5 Canvas element. You can set filling Style of the button when the mouse cursor comes in, goes out and when the button is pressed. It is also possible to define button text, its font style and color. If the text is bigger than the button width, it is automatically adjusted. If you fill that simple colors are boring, no problem, define a gradient and put it as the button color. A function name and its arguments can passed into the button creation function; so when the button is pressed, it will get ran. You can easily add different features to the function below, but if you are a beginner, leave the function definition codes and just learn how to use it. Enjoy!

If you don't know how to use this code or need more information Click here!


You can leave comments once you sign in/up.


Online Users: 3
Total Online Users: 12
Recent Members: Hectortam,, KarianaJuida, asif raza, rankwebsite
Twitter LinkedIn Youtube

Download Link to us:


Please put this code in your page.