I have here a canvas and in this I want to output a number which works but I want to output the number with a HTML tag. Here is the relevant part of the code:
function createCircle(x, y, text, callback) {
var radius = 75;
var endPercent = 3001;
var curPerc = 0;
var counterClockwise = false;
var circ = Math.PI * 2;
var quart = Math.PI / 2;
var text = '<span class="number">30</span>';
context.lineWidth = 10;
context.strokeStyle = '#ad2323';
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
function doText(context, x, y, text) {
context.lineWidth = 1;
context.fillStyle = "#ad2323";
context.lineStyle = "#ad2323";
context.font = "28px sans-serif";
context.fillText(text, x - 15, y + 5);
}
Here is a Fiddle