Make elements "known" to functions in JavaScript before assignment
I am writing a page using JavaScript, and I have 4 divs, all of which are from the same class. Each div has a function that changes the styles of the other divs (border colour and background colour, for example). The problem is t开发者_StackOverflowhat the last div does not get affected by the functions of the divs above it, because it was not "assigned" yet. Is there any way to fix this?
window.onload = function() {
};
Make sure you run your code when the window has completely loaded.
精彩评论