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 162: Module 8 Programming Project
*{ font-family: monospace; }
//------------//
// Exceptions //
//------------//
console.log("Exceptions");
//1. Chapter 87. 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 (myVar===true){
console.log("x is true.");
}
//-----------------//
// Form Validation //
//-----------------//
console.log("Form Validation");
//1. Chapter 82. 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 1 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.log("More On Events");
//1. Chapter 89. Attach onfocus and onblur events to the "name" field below using
// only JavaScript, i.e., 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!