<canvas width="500" height="500" id="mycanvas4"></canvas>
let canvas = document.getElementById('mycanvas4')
if (canvas.getContext) {
  let ctx = canvas.getContext('2d')
  ctx.beginPath()
  ctx.moveTo(100, 100)
  ctx.quadraticCurveTo(150, 150, 100, 200)
  ctx.stroke()
  
} else {
  console.log('浏览器不支持canvas')
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.