EDITABLE CODE:
LiveDemo: HTML5 Canvas Filled Rectangles
NOTE-If do not specify the fillStyle property, the fill color is black by default.