message
to say "Here is the message".
This works by adding the following code within the click event:
document.getElementsByClassName('message')[0].textContent="Here is the message";
onclick
event handler to change the text inside the message
element to say "Here is the message".
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\]\.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.');
```
```