Let me ask my friends in SF. In the code below, colors has three variables, which are three colors.
So, if you run it in chrome and colors[0] is 0, then run wihte, won't it change the color of the code with the id of colors in the html file?
var colors = new Array('wihte',
'black',
'custom')
var el = document.getElementById('colors');
el.textContent = colors[0];
天蓬老师2017-07-05 11:07:53
When you simply operate an array, you only change the values in the array, which has no meaning. The real change to the html is when you operate the dom