Which JavaScript code segment should you use?

You are developing a customer web form that includes the following HTML.

<label id="txtValue"X/label>

Information from the web form is submitted to a web service. The web service returns the following JSON object.

{

"Confirmation": "1234",

"FirstName": "John"

}

You need to display the Confirmation number from the JSON response in the txtValue label field.

Which JavaScript code segment should you use?
A . $("#txtValue").val = (JSONObject.Confirmation);
B . $("#txtValue").val (JSONObject.Confirmation);
C . $("#txtValue").text = (JSONObject.Confirmation);
D . $("#txtValue").text (JSONObject.Confirmation);

Answer: D

Explanation:

Incorrect:

not A, not B: A label object has no value attribute.

Reference:

http://api.jquery.com/text/

Latest 70-480 Dumps Valid Version with 288 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments