javascript - Regarding creating arrays, will the array values ​​change the html.
女神的闺蜜爱上我
女神的闺蜜爱上我 2017-07-05 11:05:53
0
1
800

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];

女神的闺蜜爱上我
女神的闺蜜爱上我

reply all(1)
Peter_Zhu

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template