Which code segment should you use?

You are creating a web form that users will use to enter their personal information. The form includes the following HTML.

You have the following requirements:
When a user enters an input box, the cell on the right must turn green.
When a user leaves an input box, the ceil on the right must turn white.
You need to create the web form to meet these requirements.
Which code segment should you use?

You are creating a web form that users will use to enter their personal information. The form includes the following HTML.

You have the following requirements:
When a user enters an input box, the cell on the right must turn green.
When a user leaves an input box, the ceil on the right must turn white.
You need to create the web form to meet these requirements.
Which code segment should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Philip Keefer

Philip Keefer

To make it work for me, I had to remove the space between the td: and nth-child(2).
This is what I tested..
$(document).ready(function() {
$(“table td:nth-child(2) input”).focus(
function () {
$(this).parent().next().css(“background-color”, “#00FF00”);
});
$(“td:nth-child(2) input”).blur(
function() {
$(this).parent().next().css(“background-color”, “#FFFFFF”);
});
});