Merge pull request #15785 from Manish-Giri/fix/use-single-quotes-jquery-selectors

fix(challenges): Remove double quote requirement in jQuery selectors
pull/15789/head
Dylan 2017-08-21 12:20:41 -05:00 committed by GitHub
commit b5bc822acf
1 changed files with 2 additions and 4 deletions

View File

@ -108,8 +108,7 @@
"jQuery often selects an HTML element with a <code>selector</code>, then does something to that element.",
"For example, let's make all of your <code>button</code> elements bounce. Just add this code inside your document ready function:",
"<code>$(\"button\").addClass(\"animated bounce\");</code>",
"Note that we've already included both the jQuery library and the Animate.css library in the background so that you can use them in the editor. So you are using jQuery to apply the Animate.css <code>bounce</code> class to your <code>button</code> elements.",
"Additionally make sure to use <code>$(\"button\").addClass(\"animated bounce\");</code> instead of <code>$('button').addClass(\"animated bounce\");</code> since single-quote selectors will not pass our tests."
"Note that we've already included both the jQuery library and the Animate.css library in the background so that you can use them in the editor. So you are using jQuery to apply the Animate.css <code>bounce</code> class to your <code>button</code> elements."
],
"challengeSeed": [
"fccss",
@ -144,8 +143,7 @@
],
"tests": [
"assert($(\"button\").hasClass(\"animated\") && $(\"button\").hasClass(\"bounce\"), 'message: Use the jQuery <code>addClass&#40&#41</code> function to give the classes <code>animated</code> and <code>bounce</code> to your <code>button</code> elements.');",
"assert(!code.match(/class.*animated/g), 'message: Only use jQuery to add these colors to the element.');",
"assert(/'/g.test(code) === false , 'message: Only use double quotes in your jQuery code, as is stated in the jQuery style guide.');"
"assert(!code.match(/class.*animated/g), 'message: Only use jQuery to add these colors to the element.');"
],
"type": "waypoint",
"challengeType": 0,