Javascript window.onload() function
JS DOM & events
EXP:
40

Javascript window.onload() function

window.onload is an event handler in JavaScript that is executed when the entire web page, including all dependent resources like images and styles, has finished loading.

Initial Javascript for this problem is already written for you. Your task in this problem is to assign the change the text inside #randomText element using window.onload function.

S. no Problem
1 change the text "Initial stuff" to "What's up?" using window.onload function

INSTRUCTIONS

Inside Script Tag Instruction
define a function updateText(){
// follow instructions here
}
inside it select #randomText element
set the #randomText element's textContent to "What's up?"
define a function updateText(){
// first two instructions written here
}
// this step comes here
set window.onload = updateText





    - Final

    React



    Evaluation
    • After submission, your solution will be evaluated automatically based on the tasks defined above.
    • Upon successful completion of all the tasks/requirements, you will get a full score, and there will not be any partial scoring.
    • You can work on your failed test cases & resubmit your solution.
    • Your problem will get evaluated instantly.

    Do’s & don’t
    • Use the given code structure in editor and do not make any changes.
    • Do not modify existing classes or tags.
    • Focus on correct HTML structure and class names.

    Query & feedback
    • In case of any query/feedback on this project, please fill this form & we will soon get in touch with you to resolve.

    Best of luck, developers!