diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index b6a4616b27..004a73c04c 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -460,6 +460,57 @@ ], "type": "waypoint", "challengeType": 0 + }, + { + "id": "564944c91be2204b269d51e3", + "title": "Change Text Inside an Element Using jQuery", + "description": [ + "Using jQuery, you can change the text between the start and end tags of an element. You can even change HTML markup.", + "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(\"<i>jQuery Funhouse</i>\");", + "jQuery also has a similar function called .text() that only alters text without adding tags.", + "Change the button with id target4 by italicizing its text." + ], + "tests": [ + "assert.isTrue((//gi).test($(\"#target4\").html()), 'Italicize the text in your target4 button by adding HTML tags.')", + "assert($(\"#target4\") && $(\"#target4\").text() === '#target4', 'Make sure the text is otherwise unchanged.')", + "assert.isFalse((//gi).test($(\"h3\").html()), 'Do not alter any other text.')" + ], + "challengeSeed": [ + "fccss", + " $(document).ready(function() {", + " $(\"#target1\").css(\"color\", \"red\");", + "", + " });", + "fcces", + "", + "", + "", + "
", + "

jQuery Playground

", + "
", + "
", + "

#left-well

", + "
", + " ", + " ", + " ", + "
", + "
", + "
", + "

#right-well

", + "
", + " ", + " ", + " ", + "
", + "
", + "
", + "
" + ], + "type": "waypoint", + "challengeType": 0 }, { "id": "bad87fee1348bd9aed708826",