fix(challenges): change innerHTML to textContent (#160)

* fix(challenges): change innerHTML to textContent

ISSUES CLOSED: freeCodeCamp/freeCodeCamp#17888

* update quotes to be consistent w/ other challenges
This commit is contained in:
Guy Even
2018-07-20 22:50:22 +03:00
committed by Beau Carnes
parent 5b27dfdeff
commit 06e1ba176e

View File

@ -101,16 +101,16 @@
"When the click event happens, you can use JavaScript to update an HTML element.", "When the click event happens, you can use JavaScript to update an HTML element.",
"For example, when a user clicks the \"Get Message\" button, it changes the text of the element with the class <code>message</code> to say \"Here is the message\".", "For example, when a user clicks the \"Get Message\" button, it changes the text of the element with the class <code>message</code> to say \"Here is the message\".",
"This works by adding the following code within the click event:", "This works by adding the following code within the click event:",
"<code>document.getElementsByClassName('message')[0].innerHTML=\"Here is the message\";</code>", "<code>document.getElementsByClassName('message')[0].textContent=\"Here is the message\";</code>",
"<hr>", "<hr>",
"Add code inside the <code>onclick</code> event handler to change the text inside the <code>message</code> element to say \"Here is the message\"." "Add code inside the <code>onclick</code> event handler to change the text inside the <code>message</code> element to say \"Here is the message\"."
], ],
"tests": [ "tests": [
{ {
"text": "text":
"Your code should use the <code>document.getElementsByClassName</code> method to select the element with class <code>message</code> and set its <code>innerHTML</code> to the given string.", "Your code should use the <code>document.getElementsByClassName</code> method to select the element with class <code>message</code> and set its <code>textContent</code> to the given string.",
"testString": "testString":
"assert(code.match(/document\\.getElementsByClassName\\(\\s*?('|\")message\\1\\s*?\\)\\[0\\]\\.innerHTML\\s*?=\\s*?('|\")Here is the message\\2/g), 'Your code should use the <code>document.getElementsByClassName</code> method to select the element with class <code>message</code> and set its <code>innerHTML</code> to the given string.');" "assert(code.match(/document\\.getElementsByClassName\\(\\s*?('|\")message\\1\\s*?\\)\\[0\\]\\.textContent\\s*?=\\s*?('|\")Here is the message\\2/g), 'Your code should use the <code>document.getElementsByClassName</code> method to select the element with class <code>message</code> and set its <code>textContent</code> to the given string.');"
} }
], ],
"solutions": [], "solutions": [],