Difference between revisions of "Canvas Element"

From Level Access Web Labs
Jump to navigation Jump to search
Line 16: Line 16:
  
 
<script>
 
<script>
 +
window.addEventListener('DOMContentLoaded', (event) => {
 +
  setup();
 +
});
 +
 +
function setup() {
 
var canvas=document.getElementById('myCanvas');
 
var canvas=document.getElementById('myCanvas');
 
var ctx=canvas.getContext('2d');
 
var ctx=canvas.getContext('2d');
Line 28: Line 33:
 
ctx.fillStyle='#00FF00';
 
ctx.fillStyle='#00FF00';
 
ctx.fillRect(0,0,90,90);
 
ctx.fillRect(0,0,90,90);
 +
}
 
</script>
 
</script>
 
</html>
 
</html>

Revision as of 03:26, 9 November 2021

There is more fallback text.

this is fallback text

--

There is a green box on the screen.

--

Test results for canvus-

All screen readers and browsers tested announced that there is a green box on the screen. this is the text that is in the paragraph inside of the canvus.