From 06e1ba176e2204c68631bf11b70ce9c335353956 Mon Sep 17 00:00:00 2001 From: Guy Even Date: Fri, 20 Jul 2018 22:50:22 +0300 Subject: [PATCH] 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 --- challenges/04-data-visualization/json-apis-and-ajax.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/challenges/04-data-visualization/json-apis-and-ajax.json b/challenges/04-data-visualization/json-apis-and-ajax.json index 37dfe43c22..9ce28d7d1e 100644 --- a/challenges/04-data-visualization/json-apis-and-ajax.json +++ b/challenges/04-data-visualization/json-apis-and-ajax.json @@ -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 message to say \"Here is the message\".", "This works by adding the following code within the click event:", - "document.getElementsByClassName('message')[0].innerHTML=\"Here is the message\";", + "document.getElementsByClassName('message')[0].textContent=\"Here is the message\";", "
", "Add code inside the onclick event handler to change the text inside the message element to say \"Here is the message\"." ], "tests": [ { "text": - "Your code should use the document.getElementsByClassName method to select the element with class message and set its innerHTML to the given string.", + "Your code should use the document.getElementsByClassName method to select the element with class message and set its textContent 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 document.getElementsByClassName method to select the element with class message and set its innerHTML 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 document.getElementsByClassName method to select the element with class message and set its textContent to the given string.');" } ], "solutions": [],