From 3636b76f7b549f3e3dc1a9752ec454dc502971ae Mon Sep 17 00:00:00 2001 From: ahstro Date: Thu, 6 Aug 2015 23:28:27 +0200 Subject: [PATCH] Improves 'Target Elements by ID Using jQuery' --- seed/challenges/jquery-ajax-and-json.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/seed/challenges/jquery-ajax-and-json.json b/seed/challenges/jquery-ajax-and-json.json index dad707f590..ce8cf694d9 100644 --- a/seed/challenges/jquery-ajax-and-json.json +++ b/seed/challenges/jquery-ajax-and-json.json @@ -153,15 +153,17 @@ "dashedName": "waypoint-target-elements-by-id-using-jquery", "difficulty": 3.04, "description": [ - "You can also target elements by their id attributes.", - "First target your div element with the class \"target3\" by using the $('#target3') selector.", - "Note that, just like with CSS declarations, you type a # before the class's name.", - "Then use jQuery's .addClass() function to add the classes \"animated\" and \"fadeOut\".", - "Make all the button element with the id \"target3\" fadeOut. $('#target3').addClass('animated fadeOut')." + "Just like you can target elements by their classes, you can also target them by their id attributes.", + "First target the element with the id target3 by using the $('#target3') selector.", + "Note that, just like with CSS selectors, you type a # before the id's name.", + "Then use jQuery's .addClass() function to add the class fadeOut.", + "Since #target3 is a button, and we already added the animated-class to all button-elements, we do not need to add it again.", + "Make all the elements with the id target3 fade out. $('#target3').addClass('fadeOut')." ], "tests": [ - "assert($('#target3').hasClass('animated') && $('#target3').hasClass('fadeOut'), 'Select the buttonelement with the id of \"target3\" and use the jQuery addClass() function to give it the classes of \"animated\" and \"fadeOut\".');", - "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');" + "assert($('#target3').hasClass('animated'), 'Make sure the old animated-class is still added to all buttons.')", + "assert($('#target3').hasClass('fadeOut'), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.')", + "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" ], "challengeSeed": [ "fccss",