November 25, 201312 yr Hello, I have a question about the .innerHTML in javascript. is it possible to do what im trying to do this method? function action(){ document.getElementById('films').innerHTML = for(a=0;a<movie.length;a++){document.write(movie[a]);}; } is there a better way or would this the correct method?
December 4, 201312 yr Bit of a late reply, but a something like this would do the job (not tested): function action() { var films = document.getElementById('films'); for(var a = 0, aLen = movie.length; a < aLen; a++) { films.innerHTML+= movie[a]; } }
Create an account or sign in to comment