Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Which of the following can you NOT format using CSS3 pseudo-classes? (1pts) v

ID: 3586403 • Letter: 1

Question

1)

Which of the following can you NOT format using CSS3 pseudo-classes?

(1pts)

valid fields

invalid fields

required fields

non-required fields

2)

What does an HTML5 type attribute for an input element do?

(1pts)

It validates the data entered by the user.

It indicates the type of data the user should enter in the control.

It indicates the type of control the browser should display to the user.

It makes working with CSS easier.

3)

You can use a handler for the submit event of a form to validate data when the user clicks a

(1pts)

regular button

radio button

submit button

link

4)

Which of the following is not a jQuery selector for working with forms and controls?

(1pts)

:hidden

:disabled

:text

:submit

5)

Which of the following HTML5 attributes is used for data validation?

(1pts)

pattern

autofocus

action

placeholder

6)

Which of the following methods removes all the spaces before and after an entry in a text box?

(1pts)

val()

trim()

text()

select()

7)

The jQuery features for forms and controls let you do all but one of the following. Which one is it?

(1pts)

set the values of error messages

get the value in a text box

select the check boxes that are checked

validate specific types of entries in text boxes

8)

Code example 10-2
$(document).ready(function() {
    $("#member_form").submit(
        function(event) {
            var isValid = true;
            .
            .
            var password = $("#password").val().trim();
            if (password == "") {
                $("#password").next().text("This field is required.");
                isValid = false;
            } else if ( password.length < 6) {
                $("#password").next().text("Must be 6 or more characters.");
                isValid = false;
            } else {
                $("#password").next().text("");
            }
            $("#password").val(password);
            .
            .
            if (isValid == false) { event.preventDefault(); }
        }
    );
});

(Refer to code example 10-2) What does the preventDefault() method in this code do?

(1pts)

It cancels the change() event method of the form.

It cancels the submit() event method of the form.

It triggers the change() event method of the form.

It triggers the submit() event method of the form.

9)

In the following code, what does the line of code in the else clause do?
$(document).ready(function() {
    $("#join_list").click(function() { // join_list is a regular button
        if ( $("email_address").val() == "") {
            alert("Please enter an email address.");
        } else {
            $("#email_form").submit();
        }
    });

});

(1pts)

It handles the submit() event method.

It triggers the submit() event method.

It handles the click() event method.

It triggers the click() event method.

10)

Which of the following methods is not one of the methods that trigger events?

(1pts)

focus()

change()

leave()

select()

Explanation / Answer

1)

CSS3 pseudo-classes does not have a support for non-required fields.

Hence, the correct option is non-required fields.

2)

HTML5 has type attributes like text, serach, number email, etc. So it validates the type of data the user should enter.

Hence, the correct option is it indicates the type of data the user should enter in the control.

3)

The data is validated at the time of the form submission and for submitting the form submit button is used.

Hence, the correct option is :hidden.

4)

JQuery has text, disabled and submit selector that works with the froms and control.

Hence, the correct option is submit button.

5)

In HTML5 data validation is done by matching the input with the pattern. HTML5 supports the pattern matching.

Hence, the correct answer is pattern.

6)

Spaces before and after a entry in atextbox can be removed from the textbox by using the trim() function.

Hence, the correct answer is trim().

7)

JQuery provides form validator that can be used for validating an input.

Hence, the correct answer is validate specific types of entries in text boxes.

8)

The given code has a handler that triggers a submit event on the password validation.

Hence, the correct answer is it triggers the submit() event method of the form.

9)

The code given uses a if-else clause that handles the click event. It checks that whether a user enters a email address or not.

Hence, the correct answer is it handles the click() event method.

10)

focus(), change(), and select() are the methods that works with the trigger events.

Hence, the correct answer is leave().