+ 19
Can we use onlaod attribute to call function that gets inputs from the user in order to use these inputs in our html page?
<html_element onload="function()"></html_element> if the answer is yes, could you give me an example, please?
5 Antworten
+ 21
Airree thanks a lot for your help
+ 9
You can do it entirely in JS:
window.onload = () => {
let name = prompt("Enter your name");
document.getElementById("temp").innerHTML = `Your name is ${name}`;
}
+ 1
https://www.sololearn.com/Discuss/1819573/?ref=app
Sololearn survey 2019
- 1
Hey is there some one who is still learning javascript
- 1
Ok i get it thanks