JSFiddle - React, Tailwind, and code Playground

by yinyann

HTML

<canvas id="myCanvas"></canvas>

JavaScript

if (!window.WebGLRenderingContext) {
    alert("WebGL is unknown");
  } else {
    var canvas = document.getElementById("myCanvas");
    var ctx = canvas.getContext("webgl");
    if (!ctx) {
      // browser supports WebGL but initialization failed.
        alert("initialization failed");
    }
      else{
          alert("ok");
      }
  }