help with code

+1 william appiah-dankwah · March 9, 2015
i am trying to get this loop to work with this array i have put in an object literal i dont know what to do help needed.

var Yellow = {

say: function(){

var Can = new Array();

Can[0]  = "Blue";
Can[1] = "Green";

for(var i = 0; i < 10; i++){

document.getElementById('Plane').innerHTML = i[1];

}
}
};
Yellow.say();
































Post a Reply

Replies

- page 1
Oldest  Newest  Rating
+1 Hossein Vahabi · March 16, 2015
try this


window.onload = function (){

var Can = new Array();

for(var i=0;i
0 william appiah-dankwah · March 19, 2015
nice mr doug fresh!?! what problem would i have run into with this basic code? the code is supposed to display the whole content  of the array one the loop is executed. why should i write comments in the forum uv worked out how iv written the code. 
0 william appiah-dankwah · March 9, 2015
i want to use getElementById() were do i find a list of properties and methods for the dom elements i think it is?
0 william appiah-dankwah · March 16, 2015
Write out the full code 
0 william appiah-dankwah · March 17, 2015

window.onload = function() {

var Can = new Array();

Can[0] = "Blue";
Can[1] = "Green";

for(var i =0; i < 10; i++) {

var Flap = document.getElementById('Plane');

Flap.innerHTML += Can;
}
}


is this what you meant? 
0 william appiah-dankwah · March 17, 2015
Its definitely not an interger the loop 100% works in the code iv written so so should the array 
0 william appiah-dankwah · March 17, 2015
Is that the ligue lumie? 
0 william appiah-dankwah · March 17, 2015
The code is not asking to display an interger it's asking to display the array in a loop
0 william appiah-dankwah · March 18, 2015
fwhats your problem man you can see that in the code!

Var Flap = getElementById('Plane');

Flap.innerHTML += Can;

0 william appiah-dankwah · March 18, 2015
look man. how do you troll? did you use the code?
  • 1
  • 2

Javascript

107,068 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators