<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>文字排版</title>
<script type="text/javascript">
function clearmap(){
context.clearRect(0,0,300,200);
}
</script>
</head>
<body>
<canvas id="canvas" width="700" height="300" style="border:1px solid"></canvas>
</body>
<script type="text/javascript">
function draw(){
var c=document.getElementById("canvas");
var context = c.getContext("2d");
var radgrad = context.createRadialGradient(55,55,20,100,100,90);
radgrad.addColorStop(0,'#ffffff');
radgrad.addColorStop(1,'#333333');
context.fillStyle=radgrad;
context.fillRect(10,10,200,200);
}
window.οnlοad=function(){
draw();
}
</script>
<input name="" type="button" value="清空画布" οnclick="clearmap();">
</html>
<html>
<head>
<meta charset="utf-8">
<title>文字排版</title>
<script type="text/javascript">
function clearmap(){
context.clearRect(0,0,300,200);
}
</script>
</head>
<body>
<canvas id="canvas" width="700" height="300" style="border:1px solid"></canvas>
</body>
<script type="text/javascript">
function draw(){
var c=document.getElementById("canvas");
var context = c.getContext("2d");
var radgrad = context.createRadialGradient(55,55,20,100,100,90);
radgrad.addColorStop(0,'#ffffff');
radgrad.addColorStop(1,'#333333');
context.fillStyle=radgrad;
context.fillRect(10,10,200,200);
}
window.οnlοad=function(){
draw();
}
</script>
<input name="" type="button" value="清空画布" οnclick="clearmap();">
</html>