how to use window.onload js code example Example: window.onload window.onload = function() { // Some code };