Imagine that you are creating a web form where the overallRa…

Imagine that you are creating a web form where the overallRating element is a selection list displaying the options “Excellent,” “Good,” “Okay,” “Poor,” and “Terrible.” After assigning a couple of variables with the following JavaScript code, you can use the selectedIndex property to _____. let custFeedback = document.forms.custFeedback; let overallRating = orderForm.elements.overallRating;

The following JavaScript code will display the message “Plea…

The following JavaScript code will display the message “Please enter your name!” instead of the browser’s native error message when executed in response to a user trying to submit a web form without entering text in the lastName field, which has the required attribute. let lastName = document.getElementById(“lastName”); lastName.setCustomValidity(“Please enter your name!”);

You can use the following JavaScript code to add a browser t…

You can use the following JavaScript code to add a browser test for the find() method that will execute the if branch to locate an element in the invoices array if this method is supported by the user’s web browser, but move on to the else branch if the method is not supported: if (invoices.find) {    let firstOverdue = invoices.find(overdue); } else { //alternate code in place of the find() method