fix(challenges): Remove double quote requirement in jQuery selectors
This commit is contained in:
@ -108,8 +108,7 @@
|
|||||||
"jQuery often selects an HTML element with a <code>selector</code>, then does something to that element.",
|
"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:",
|
"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>",
|
"<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.",
|
"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."
|
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"fccss",
|
"fccss",
|
||||||
@ -144,8 +143,7 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"button\").hasClass(\"animated\") && $(\"button\").hasClass(\"bounce\"), 'message: Use the jQuery <code>addClass()</code> function to give the classes <code>animated</code> and <code>bounce</code> to your <code>button</code> elements.');",
|
"assert($(\"button\").hasClass(\"animated\") && $(\"button\").hasClass(\"bounce\"), 'message: Use the jQuery <code>addClass()</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(!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.');"
|
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
"challengeType": 0,
|
"challengeType": 0,
|
||||||
|
Reference in New Issue
Block a user