/g), 'The opening /g), 'The opening /g).length === code.match(/ p elements has a closing tag.');"
+ "text": "Make sure each of your /g).length === code.match(/ p elements has a closing tag.');"
},
{
- "text":
- "Make sure each of your main tag should come before the first paragraph tag.');"
+ "text": "The opening main tag should come before the first paragraph tag.",
+ "testString": "assert(code.match(/main tag should come before the first paragraph tag.');"
},
{
- "text":
- "The closing main tag should come after the second closing paragraph tag.",
- "testString":
- "assert(code.match(/<\\/p>\\s*?<\\/main>/g), 'The closing main tag should come after the second closing paragraph tag.');"
+ "text": "The closing main tag should come after the second closing paragraph tag.",
+ "testString": "assert(code.match(/<\\/p>\\s*?<\\/main>/g), 'The closing main tag should come after the second closing paragraph tag.');"
}
],
"challengeType": 0,
@@ -744,20 +700,15 @@
"tests": [
{
"text": "Your page should have an image element.",
- "testString":
- "assert($(\"img\").length > 0, 'Your page should have an image element.');"
+ "testString": "assert($(\"img\").length > 0, 'Your page should have an image element.');"
},
{
- "text":
- "Your image should have a src attribute that points to the kitten image.",
- "testString":
- "assert(new RegExp(\"\\/\\/bit.ly\\/fcc-relaxing-cat|\\/\\/s3.amazonaws.com\\/freecodecamp\\/relaxing-cat.jpg\", \"gi\").test($(\"img\").attr(\"src\")), 'Your image should have a src attribute that points to the kitten image.');"
+ "text": "Your image should have a src attribute that points to the kitten image.",
+ "testString": "assert(new RegExp(\"\\/\\/bit.ly\\/fcc-relaxing-cat|\\/\\/s3.amazonaws.com\\/freecodecamp\\/relaxing-cat.jpg\", \"gi\").test($(\"img\").attr(\"src\")), 'Your image should have a src attribute that points to the kitten image.');"
},
{
- "text":
- "Your image element must have an alt attribute.",
- "testString":
- "assert(code.match(/alt\\s*?=\\s*?(\\\"|\\').*(\\\"|\\')/), 'Your image element must have an alt attribute.');"
+ "text": "Your image element must have an alt attribute.",
+ "testString": "assert(code.match(/alt\\s*?=\\s*?(\\\"|\\').*(\\\"|\\')/), 'Your image element must have an alt attribute.');"
}
],
"challengeType": 0,
@@ -817,8 +768,7 @@
]
}
},
- "guideUrl":
- "https://guide.freecodecamp.org/certificates/add-images-to-your-website",
+ "guideUrl": "https://guide.freecodecamp.org/certificates/add-images-to-your-website",
"files": {
"indexhtml": {
"key": "indexhtml",
@@ -851,21 +801,16 @@
],
"tests": [
{
- "text":
- "Your a element should have the anchor text of \"cat photos\".",
- "testString":
- "assert((/cat photos/gi).test($(\"a\").text()), 'Your a element should have the anchor text of \"cat photos\".');"
+ "text": "Your a element should have the anchor text of \"cat photos\".",
+ "testString": "assert((/cat photos/gi).test($(\"a\").text()), 'Your a element should have the anchor text of \"cat photos\".');"
},
{
- "text":
- "You need an a element that links to http://freecatphotoapp",
- "testString":
- "assert(/http:\\/\\/(www\\.)?freecatphotoapp\\.com/gi.test($(\"a\").attr(\"href\")), 'You need an a element that links to http://freecatphotoapp');"
+ "text": "You need an a element that links to http://freecatphotoapp",
+ "testString": "assert(/http:\\/\\/(www\\.)?freecatphotoapp\\.com/gi.test($(\"a\").attr(\"href\")), 'You need an a element that links to http://freecatphotoapp');"
},
{
"text": "Make sure your a element has a closing tag.",
- "testString":
- "assert(code.match(/<\\/a>/g) && code.match(/<\\/a>/g).length === code.match(/a element has a closing tag.');"
+ "testString": "assert(code.match(/<\\/a>/g) && code.match(/<\\/a>/g).length === code.match(/a element has a closing tag.');"
}
],
"challengeType": 0,
@@ -958,44 +903,33 @@
"tests": [
{
"text": "There should be only one anchor tag on your page.",
- "testString":
- "assert($('a').length == 1, 'There should be only one anchor tag on your page.');"
+ "testString": "assert($('a').length == 1, 'There should be only one anchor tag on your page.');"
},
{
- "text":
- "There should be only one footer tag on your page.",
- "testString":
- "assert($('footer').length == 1, 'There should be only one footer tag on your page.');"
+ "text": "There should be only one footer tag on your page.",
+ "testString": "assert($('footer').length == 1, 'There should be only one footer tag on your page.');"
},
{
- "text":
- "The a tag should have an href attribute set to \"#footer\".",
- "testString":
- "assert($('a').eq(0).attr('href') == \"#footer\", 'The a tag should have an href attribute set to \"#footer\".');"
+ "text": "The a tag should have an href attribute set to \"#footer\".",
+ "testString": "assert($('a').eq(0).attr('href') == \"#footer\", 'The a tag should have an href attribute set to \"#footer\".');"
},
{
- "text":
- "The a tag should not have a target attribute",
- "testString":
- "assert(typeof $('a').eq(0).attr('target') == typeof undefined || $('a').eq(0).attr('target') == true, 'The a tag should not have a target attribute');"
+ "text": "The a tag should not have a target attribute",
+ "testString": "assert(typeof $('a').eq(0).attr('target') == typeof undefined || $('a').eq(0).attr('target') == true, 'The a tag should not have a target attribute');"
},
{
"text": "The a text should be \"Jump to Bottom\".",
- "testString":
- "assert($('a').eq(0).text().match(/Jump to Bottom/gi), 'The a text should be \"Jump to Bottom\".');"
+ "testString": "assert($('a').eq(0).text().match(/Jump to Bottom/gi), 'The a text should be \"Jump to Bottom\".');"
},
{
- "text":
- "The footer tag should have an id attribute set to \"footer\".",
- "testString":
- "assert($('footer').eq(0).attr('id') == \"footer\", 'The footer tag should have an id attribute set to \"footer\".');"
+ "text": "The footer tag should have an id attribute set to \"footer\".",
+ "testString": "assert($('footer').eq(0).attr('id') == \"footer\", 'The footer tag should have an id attribute set to \"footer\".');"
}
],
"challengeType": 0,
"translations": {
"pt-br": {
- "title":
- "Crie links para seções internas de uma página com elementos âncora",
+ "title": "Crie links para seções internas de uma página com elementos âncora",
"description": [
"Além de criar links externos, elementos âncora também podem ser usados para criar links internos, que são links que pulam para diferentes seções dentro de uma mesma página.",
"O formato é parecido com um link externo, só que, ao invés de uma URL no atributo href, você usa o símbolo # e uma palavra para descrever a seção para a qual você quer pular.",
@@ -1056,52 +990,36 @@
],
"tests": [
{
- "text":
- "You need an a element that links to \"http://freecatphotoapp.com\".",
- "testString":
- "assert(($(\"a[href=\\\"http://freecatphotoapp.com\\\"]\").length > 0 || $(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").length > 0), 'You need an a element that links to \"http://freecatphotoapp.com\".');"
+ "text": "You need an a element that links to \"http://freecatphotoapp.com\".",
+ "testString": "assert(($(\"a[href=\\\"http://freecatphotoapp.com\\\"]\").length > 0 || $(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").length > 0), 'You need an a element that links to \"http://freecatphotoapp.com\".');"
},
{
- "text":
- "Your a element should have the anchor text of \"cat photos\"",
- "testString":
- "assert($(\"a\").text().match(/cat\\sphotos/gi), 'Your a element should have the anchor text of \"cat photos\"');"
+ "text": "Your a element should have the anchor text of \"cat photos\"",
+ "testString": "assert($(\"a\").text().match(/cat\\sphotos/gi), 'Your a element should have the anchor text of \"cat photos\"');"
},
{
- "text":
- "Create a new p element around your a element. There should be at least 3 total p tags in your HTML code.",
- "testString":
- "assert($(\"p\") && $(\"p\").length > 2, 'Create a new p element around your a element. There should be at least 3 total p tags in your HTML code.');"
+ "text": "Create a new p element around your a element. There should be at least 3 total p tags in your HTML code.",
+ "testString": "assert($(\"p\") && $(\"p\").length > 2, 'Create a new p element around your a element. There should be at least 3 total p tags in your HTML code.');"
},
{
- "text":
- "Your a element should be nested within your new p element.",
- "testString":
- "assert(($(\"a[href=\\\"http://freecatphotoapp.com\\\"]\").parent().is(\"p\") || $(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\")), 'Your a element should be nested within your new p element.');"
+ "text": "Your a element should be nested within your new p element.",
+ "testString": "assert(($(\"a[href=\\\"http://freecatphotoapp.com\\\"]\").parent().is(\"p\") || $(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\")), 'Your a element should be nested within your new p element.');"
},
{
- "text":
- "Your p element should have the text \"View more \" (with a space after it).",
- "testString":
- "assert(($(\"a[href=\\\"http://freecatphotoapp.com\\\"]\").parent().text().match(/View\\smore\\s/gi) || $(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().text().match(/View\\smore\\s/gi)), 'Your p element should have the text \"View more \" (with a space after it).');"
+ "text": "Your p element should have the text \"View more \" (with a space after it).",
+ "testString": "assert(($(\"a[href=\\\"http://freecatphotoapp.com\\\"]\").parent().text().match(/View\\smore\\s/gi) || $(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().text().match(/View\\smore\\s/gi)), 'Your p element should have the text \"View more \" (with a space after it).');"
},
{
- "text":
- "Your a element should not have the text \"View more\".",
- "testString":
- "assert(!$(\"a\").text().match(/View\\smore/gi), 'Your a element should not have the text \"View more\".');"
+ "text": "Your a element should not have the text \"View more\".",
+ "testString": "assert(!$(\"a\").text().match(/View\\smore/gi), 'Your a element should not have the text \"View more\".');"
},
{
- "text":
- "Make sure each of your p elements has a closing tag.",
- "testString":
- "assert(code.match(/<\\/p>/g) && code.match(/p elements has a closing tag.",
+ "testString": "assert(code.match(/<\\/p>/g) && code.match(/a elements has a closing tag.",
- "testString":
- "assert(code.match(/<\\/a>/g) && code.match(//g).length === code.match(/a elements has a closing tag.');"
+ "text": "Make sure each of your a elements has a closing tag.",
+ "testString": "assert(code.match(/<\\/a>/g) && code.match(//g).length === code.match(/a elements has a closing tag.');"
}
],
"challengeType": 0,
@@ -1189,10 +1107,8 @@
],
"tests": [
{
- "text":
- "Your a element should be a dead link with the value of the href attribute set to \"#\".",
- "testString":
- "assert($(\"a\").attr(\"href\") === \"#\", 'Your a element should be a dead link with the value of the href attribute set to \"#\".');"
+ "text": "Your a element should be a dead link with the value of the href attribute set to \"#\".",
+ "testString": "assert($(\"a\").attr(\"href\") === \"#\", 'Your a element should be a dead link with the value of the href attribute set to \"#\".');"
}
],
"challengeType": 0,
@@ -1269,22 +1185,16 @@
],
"tests": [
{
- "text":
- "Nest the existing img element within an a element.",
- "testString":
- "assert($(\"a\").children(\"img\").length > 0, 'Nest the existing img element within an a element.');"
+ "text": "Nest the existing img element within an a element.",
+ "testString": "assert($(\"a\").children(\"img\").length > 0, 'Nest the existing img element within an a element.');"
},
{
- "text":
- "Your a element should be a dead link with a href attribute set to #.",
- "testString":
- "assert(new RegExp(\"#\").test($(\"a\").children(\"img\").parent().attr(\"href\")), 'Your a element should be a dead link with a href attribute set to #.');"
+ "text": "Your a element should be a dead link with a href attribute set to #.",
+ "testString": "assert(new RegExp(\"#\").test($(\"a\").children(\"img\").parent().attr(\"href\")), 'Your a element should be a dead link with a href attribute set to #.');"
},
{
- "text":
- "Make sure each of your a elements has a closing tag.",
- "testString":
- "assert(code.match(/<\\/a>/g) && code.match(//g).length === code.match(/a elements has a closing tag.');"
+ "text": "Make sure each of your a elements has a closing tag.",
+ "testString": "assert(code.match(/<\\/a>/g) && code.match(//g).length === code.match(/a elements has a closing tag.');"
}
],
"challengeType": 0,
@@ -1371,24 +1281,19 @@
"tests": [
{
"text": "Create a ul element.",
- "testString":
- "assert($(\"ul\").length > 0, 'Create a ul element.');"
+ "testString": "assert($(\"ul\").length > 0, 'Create a ul element.');"
},
{
- "text":
- "You should have three li elements within your ul element.",
- "testString":
- "assert($(\"ul li\").length > 2, 'You should have three li elements within your ul element.');"
+ "text": "You should have three li elements within your ul element.",
+ "testString": "assert($(\"ul li\").length > 2, 'You should have three li elements within your ul element.');"
},
{
"text": "Make sure your ul element has a closing tag.",
- "testString":
- "assert(code.match(/<\\/ul>/gi) && code.match(//gi).length === code.match(/
ul element has a closing tag.');"
+ "testString": "assert(code.match(/<\\/ul>/gi) && code.match(/
/gi).length === code.match(/
ul element has a closing tag.');"
},
{
"text": "Make sure your
li elements have closing tags.",
- "testString":
- "assert(code.match(/<\\/li>/gi) && code.match(/li elements have closing tags.');"
+ "testString": "assert(code.match(/<\\/li>/gi) && code.match(/li elements have closing tags.');"
}
],
"challengeType": 0,
@@ -1477,52 +1382,40 @@
],
"tests": [
{
- "text":
- "You should have an ordered list for \"Top 3 things cats hate:\"",
- "testString":
- "assert((/Top 3 things cats hate:/i).test($(\"ol\").prev().text()), 'You should have an ordered list for \"Top 3 things cats hate:\"');"
+ "text": "You should have an ordered list for \"Top 3 things cats hate:\"",
+ "testString": "assert((/Top 3 things cats hate:/i).test($(\"ol\").prev().text()), 'You should have an ordered list for \"Top 3 things cats hate:\"');"
},
{
"text": "You should have an unordered list for \"Things cats love:\"",
- "testString":
- "assert((/Things cats love:/i).test($(\"ul\").prev().text()), 'You should have an unordered list for \"Things cats love:\"');"
+ "testString": "assert((/Things cats love:/i).test($(\"ul\").prev().text()), 'You should have an unordered list for \"Things cats love:\"');"
},
{
"text": "You should have only one ul element.",
- "testString":
- "assert.equal($(\"ul\").length, 1, 'You should have only one ul element.');"
+ "testString": "assert.equal($(\"ul\").length, 1, 'You should have only one ul element.');"
},
{
"text": "You should have only one ol element.",
- "testString":
- "assert.equal($(\"ol\").length, 1, 'You should have only one ol element.');"
+ "testString": "assert.equal($(\"ol\").length, 1, 'You should have only one ol element.');"
},
{
- "text":
- "You should have three li elements within your ul element.",
- "testString":
- "assert.equal($(\"ul li\").length, 3, 'You should have three li elements within your ul element.');"
+ "text": "You should have three li elements within your ul element.",
+ "testString": "assert.equal($(\"ul li\").length, 3, 'You should have three li elements within your ul element.');"
},
{
- "text":
- "You should have three li elements within your ol element.",
- "testString":
- "assert.equal($(\"ol li\").length, 3, 'You should have three li elements within your ol element.');"
+ "text": "You should have three li elements within your ol element.",
+ "testString": "assert.equal($(\"ol li\").length, 3, 'You should have three li elements within your ol element.');"
},
{
"text": "Make sure your ul element has a closing tag.",
- "testString":
- "assert(code.match(/<\\/ul>/g) && code.match(/<\\/ul>/g).length === code.match(//g).length, 'Make sure your
ul element has a closing tag.');"
+ "testString": "assert(code.match(/<\\/ul>/g) && code.match(/<\\/ul>/g).length === code.match(//g).length, 'Make sure your
ul element has a closing tag.');"
},
{
"text": "Make sure your ol element has a closing tag.",
- "testString":
- "assert(code.match(/<\\/ol>/g) && code.match(/<\\/ol>/g).length === code.match(//g).length, 'Make sure your
ol element has a closing tag.');"
+ "testString": "assert(code.match(/<\\/ol>/g) && code.match(/<\\/ol>/g).length === code.match(//g).length, 'Make sure your
ol element has a closing tag.');"
},
{
"text": "Make sure your li element has a closing tag.",
- "testString":
- "assert(code.match(/<\\/li>/g) && code.match(/li element has a closing tag.');"
+ "testString": "assert(code.match(/<\\/li>/g) && code.match(/li element has a closing tag.');"
}
],
"challengeType": 0,
@@ -1617,10 +1510,8 @@
],
"tests": [
{
- "text":
- "Your app should have an input element of type text.",
- "testString":
- "assert($(\"input[type=text]\").length > 0, 'Your app should have an input element of type text.');"
+ "text": "Your app should have an input element of type text.",
+ "testString": "assert($(\"input[type=text]\").length > 0, 'Your app should have an input element of type text.');"
}
],
"challengeType": 0,
@@ -1719,22 +1610,16 @@
],
"tests": [
{
- "text":
- "Add a placeholder attribute to the existing text input element.",
- "testString":
- "assert($(\"input[placeholder]\").length > 0, 'Add a placeholder attribute to the existing text input element.');"
+ "text": "Add a placeholder attribute to the existing text input element.",
+ "testString": "assert($(\"input[placeholder]\").length > 0, 'Add a placeholder attribute to the existing text input element.');"
},
{
- "text":
- "Set the value of your placeholder attribute to \"cat photo URL\".",
- "testString":
- "assert($(\"input\") && $(\"input\").attr(\"placeholder\") && $(\"input\").attr(\"placeholder\").match(/cat\\s+photo\\s+URL/gi), 'Set the value of your placeholder attribute to \"cat photo URL\".');"
+ "text": "Set the value of your placeholder attribute to \"cat photo URL\".",
+ "testString": "assert($(\"input\") && $(\"input\").attr(\"placeholder\") && $(\"input\").attr(\"placeholder\").match(/cat\\s+photo\\s+URL/gi), 'Set the value of your placeholder attribute to \"cat photo URL\".');"
},
{
- "text":
- "The finished input element should have valid syntax.",
- "testString":
- "assert($(\"input[type=text]\").length > 0 && code.match(/\\s]+))?)+\\s*|\\s*)\\/?>/gi), 'The finished input element should have valid syntax.');"
+ "text": "The finished input element should have valid syntax.",
+ "testString": "assert($(\"input[type=text]\").length > 0 && code.match(/\\s]+))?)+\\s*|\\s*)\\/?>/gi), 'The finished input element should have valid syntax.');"
}
],
"challengeType": 0,
@@ -1780,8 +1665,7 @@
]
}
},
- "guideUrl":
- "https://guide.freecodecamp.org/certificates/add-placeholder-text-to-a-text-field",
+ "guideUrl": "https://guide.freecodecamp.org/certificates/add-placeholder-text-to-a-text-field",
"files": {
"indexhtml": {
"key": "indexhtml",
@@ -1826,22 +1710,16 @@
],
"tests": [
{
- "text":
- "Nest your text input element within a form element.",
- "testString":
- "assert($(\"form\") && $(\"form\").children(\"input\") && $(\"form\").children(\"input\").length > 0, 'Nest your text input element within a form element.');"
+ "text": "Nest your text input element within a form element.",
+ "testString": "assert($(\"form\") && $(\"form\").children(\"input\") && $(\"form\").children(\"input\").length > 0, 'Nest your text input element within a form element.');"
},
{
- "text":
- "Make sure your form has an action attribute which is set to /submit-cat-photo",
- "testString":
- "assert($(\"form\").attr(\"action\") === \"/submit-cat-photo\", 'Make sure your form has an action attribute which is set to /submit-cat-photo');"
+ "text": "Make sure your form has an action attribute which is set to /submit-cat-photo",
+ "testString": "assert($(\"form\").attr(\"action\") === \"/submit-cat-photo\", 'Make sure your form has an action attribute which is set to /submit-cat-photo');"
},
{
- "text":
- "Make sure your form element has well-formed open and close tags.",
- "testString":
- "assert(code.match(/<\\/form>/g) && code.match(/