diff --git a/challenges/jquery.json b/challenges/jquery.json
index 43f7b26843..e66108d6d4 100644
--- a/challenges/jquery.json
+++ b/challenges/jquery.json
@@ -257,6 +257,7 @@
"title": "Target the same element with multiple jQuery Selectors",
"description": [
"Now you know three ways of targeting elements: by type: $(\"button\")
, by class: $(\".btn\")
, and by id $(\"#target1\")
.",
+ "Although it is possible to add multiple classes in a single .addClass()
call, let's add them to the same element in three different ways.",
"Using each of the above jQuery selectors and the addClass()
function:",
"Add the animated
class to all elements with type button
.",
"Add the shake
class to all the buttons with class .btn
.",
@@ -266,7 +267,7 @@
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?button\\s*?(?:'|\")/gi), 'Use the $(\"button\")
selector.')",
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.btn\\s*?(?:'|\")/gi), 'Use the $(\".btn\")
selector.')",
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?#target1\\s*?(?:'|\")/gi), 'Use the $(\"#target1\")
selector.')",
- "assert(editor.match(/addClass/g) && editor.match(/addClass/g).length > 2, 'Only add one class with each of your three selectors.')",
+ "assert(editor.match(/addClass/g) && editor.match(/addClass\\(\\s*?('|\")[\\w-]+\\1\\s*?\\)/g).length > 2, 'Only add one class with each of your three selectors.')",
"assert($(\"#target1\").hasClass(\"animated\") && $(\"#target1\").hasClass(\"shake\") && $(\"#target1\").hasClass(\"btn-primary\"), 'Your #target1
element should have the classes animated
shake
and btn-primary
.')",
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
],