Question: I need help with my JavaScript project. CMPS 1 6 2 : Module 8 Programming Project * { font - family: monospace; } / /
I need help with my JavaScript project.
CMPS : Module Programming Project
fontfamily: monospace;
Exceptions
console.logExceptions;
Chapter The if statement below will throw an error myVar is
not defined Wrap the if statement in a try catch block that logs
the string an error occurred." to the console.
if myVartrue
console.logx is true.";
Form Validation
console.logForm Validation";
Chapter Implement the validateName function that should get the string
from the "name" input field and check to see if a value was provided. The
results should be reported to the user in the status div.
a The "name" field's value should be more than character long.
function validateName
implement your program here
If the value passes the test, set the innerText of the statusDiv to
"Valid name".
If it does not pass the test, set the innerText of the statusDiv to
"Invalid name".
More On Events
console.logMore On Events";
Chapter Attach onfocus and onblur events to the "name" field below using
only JavaScript, ie do not modify the HTML Change the background of the
text input field on these events.
a When the "name" field gets focus, the style.backgroundColor should be set
to pink.
b onBlur, the style.backgroundColor should be set to white.
TIP: create one function that sets the input field's background color to pink
and another function that sets the input field's background color to white.
put your background color functions here.
window.onload function
assign the onblur and onfocus event handlers here.
;
See console!
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
