From 71ab54b0b0377ac87af9c39399cfc441c3498d75 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sat, 2 Apr 2016 00:43:22 -0700 Subject: [PATCH] Clarify instructions for Change Text in jQuery - Clarify to use .html() versus .text() - Add test to check use of .html() --- .../01-front-end-development-certification/jquery.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/challenges/01-front-end-development-certification/jquery.json b/challenges/01-front-end-development-certification/jquery.json index 3c18c389ff..ddcec4176b 100644 --- a/challenges/01-front-end-development-certification/jquery.json +++ b/challenges/01-front-end-development-certification/jquery.json @@ -548,7 +548,7 @@ "jQuery has a function called .html() that lets you add HTML tags and text within an element. Any content previously within the element will be completely replaced with the content you provide using this function.", "Here's how you would rewrite and italicize the text of our heading:", "$(\"h3\").html(\"<em>jQuery Playground</em>\");", - "jQuery also has a similar function called .text() that only alters text without adding tags.", + "jQuery also has a similar function called .text() that only alters text without adding tags. In other words, this function will not evaluate any HTML tags passed to it, but will instead treat it as text you want to replace with.", "Change the button with id target4 by italicizing its text." ], "releasedOn": "November 18, 2015", @@ -587,7 +587,8 @@ "tests": [ "assert.isTrue((/#target4<\\/em>/gi).test($(\"#target4\").html()), 'message: Italicize the text in your target4 button by adding HTML tags.');", "assert($(\"#target4\") && $(\"#target4\").text() === '#target4', 'message: Make sure the text is otherwise unchanged.');", - "assert.isFalse((//gi).test($(\"h3\").html()), 'message: Do not alter any other text.');" + "assert.isFalse((//gi).test($(\"h3\").html()), 'message: Do not alter any other text.');", + "assert(code.match(/\\.html\\(/g), 'message: Make sure you are using .html() and not .text().');" ], "type": "waypoint", "challengeType": 0,