<canvas id="favoriteRectangle" width="30" height="30"></canvas>
<script>
function drawFavoriteRectangle() {
var ctx = $('#favoriteRectangle')[0].getContext('2d');
//var ctx = bg.getContext('2d');
ctx.beginPath();
ctx.moveTo(0, 20);
ctx.lineTo(10, 0);
ctx.lineTo(20, 20);
var ctx = $('#favoriteRectangle')[0].getContext('2d');
//var ctx = bg.getContext('2d');
ctx.beginPath();
ctx.moveTo(0, 20);
ctx.lineTo(10, 0);
ctx.lineTo(20, 20);
ctx.lineWidth = 2;
ctx.strokeStyle = 'black';
ctx.stroke();
}
ctx.strokeStyle = 'black';
ctx.stroke();
}
</script>