Which five JavaScript code segments should you use?

DRAG DROP
You have the following HTML markup.

You need to ensure that when a user presses btnDraw, a rectangle that has the following characteristics is
drawn:
The y-coordinate must equal 10.
The x-coordinate must equal 10.
The rectangle must have a height and width of 100.
The solution must use local variables only.
Which five JavaScript code segments should you use? Develop the solution by selecting and arranging the
required code blocks in the correct order.
Select and Place:

DRAG DROP
You have the following HTML markup.

You need to ensure that when a user presses btnDraw, a rectangle that has the following characteristics is
drawn:
The y-coordinate must equal 10.
The x-coordinate must equal 10.
The rectangle must have a height and width of 100.
The solution must use local variables only.
Which five JavaScript code segments should you use? Develop the solution by selecting and arranging the
required code blocks in the correct order.
Select and Place:

Answer:

Explanation:
function drawOnCanvas() {
var context = document.getElementById(‘canvas1’);
var context = canvas.getContext(‘2d’);
context.fillRect(10, 10, 100, 100);
}
http://techfunda.com/howto/503/canvas-rectangle



Leave a Reply 0

Your email address will not be published. Required fields are marked *