/** * Created by xuekai on 15/2/13. */ var canvas = document.getElementById('canvas'), context = canvas.getContext('2d'), context.font = '39pt Helvetica'; context.fillStyle = 'green'; context.strokeStyle = 'red'; context.fillText('Hello Canvas', canvas.width/2 - 150, canvas.height/2 + 15);