0

I have the following fiddle:

https://jsfiddle.net/6c9po3ts/1/

Currently the class colour writes some content after.

How can I with javascript change the text Green to Red?

I have tried using, without success:

var el = document.getElementsByClassName('colour');
el.textContent = el.textContent.replace('Green', 'Red');
Rickin Rathatha
  • 157
  • 1
  • 2
  • 15

0 Answers0