Which line of code should you use?

Posted by: Pdfprep Category: 70-480 Tags: , ,

You are developing an HTML5 web page.

The appearance of the text box must change when a user moves the focus to another element on the page.

You need to develop the page to respond to user action.

Which line of code should you use?
A . <input type="text" onblur="resetStyle(this);" />
B . <input type="text" onfocus="resetStyle(this);" />
C . <input type="text" onreset="resetStyle(this);" />
D . <input type="text" onselect="resetStyle(this);" />

Answer: A

Explanation:

Definition and Usage

The onblur event occurs when an object loses focus.

Example

Execute a JavaScript when a user leaves an input field:

<input type="text" onblur="myFunction()">

Reference: onblur Event

http://www.w3schools.com/jsref/event_onblur.asp

Leave a Reply

Your email address will not be published.