Replace text in a div
I know how to replace text inside a given div:
document.getElementById("containerID").innerHMTL = "some new text";
But I want to change text depending on text that is in an array.
So I have an array:
'Good' : 'Bad',
'Happy' : 'Sad',
How can I change the text in a div with the key of the array? So if my div contains the word good I want to change it to bad.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)