0
How we can add two variable whose value is given by user as input?
please give a short code of my problem!
9 Respuestas
0
Can u tell by which method has the user inputted the values
0
use prompt(); function we can ask to input a value to user.
0
use prompt(); function we can ask to input a value to user.
0
I just added it to code play ground
its name is " add two numbers"
go check it out
0
or you can find it from my profile
0
Thank you so much! for help.
0
no problem some likes would be appreciated
0
You can take advantages of using <input> elements for integrating the user inputs inside your html, instead of using prompt() function, which open a modal 'blocking' window ( all js scripts are stopped, as all display refresh unavailable while user not closing it ), not very user friendly ^^
In addition, instead of basicly document.write() the result, you can rather edit the 'innerHTML' property of an html element, when user click on button to calculate...
... It would give that:
https://code.sololearn.com/WzS1Rzioz166/#html
0
you are quite right. I was just trying to keep things simple. Thank