Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
fix(challenges): change innerHTML to textContent (#160)
Browse files Browse the repository at this point in the history
* fix(challenges): change innerHTML to textContent

ISSUES CLOSED: freeCodeCamp/freeCodeCamp#17888

* update quotes to be consistent w/ other challenges
  • Loading branch information
gforce2k5 authored and beaucarnes committed Jul 20, 2018
1 parent 5b27dfd commit 06e1ba1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions challenges/04-data-visualization/json-apis-and-ajax.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@
"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\".",
"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>",
"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": [
{
"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":
"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": [],
Expand Down

0 comments on commit 06e1ba1

Please sign in to comment.