Question: Now create a keydown event listener on the textbox so that when the Enter key is pressed in the textbox a function executes. The function
Now create a keydown event listener on the textbox so that when the Enter key is pressed in the
textbox a function executes. The function should do the following things:
Get the radius from the textbox and check if it is valid ie is between
If it is not valid produce an alert that the radius is invalid.
If the radius is valid, the canvas should be cleared and your function should loop through all of
the points in the array, drawing and filling a circle at each point using the new radius.
Here are some screenshots showing the result after pressing enter in the textbox:
Now create a keydown listener on the page to determine if the or keys are pressed. If the key
was pressed, you should execute the function you will create in step If the r key was pressed, you
should execute the function you will create in step
Create a function that gets the currently selected color from the dropdown list, then clears the canvas,
and loops through all of the points in the array, drawing and filling a circle at each point using the color
from the dropdown list.
Here are some screenshots showing pressing c after selectinc each of the different colors:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
