Using a prompt to change text inside of a div [duplicate]
问题 This question already has answers here : Why does jQuery or a DOM method such as getElementById not find the element? (8 answers) Closed 6 years ago . Ok so I have this simplified code of what I am trying to do on this page. I want the browser to display a prompt as soon as they load the page asking for their name. Once they answer what their name is it takes that variable (name) and writes it inside of the div with the id "welcomeText". It just won't work for some reason... Please help