+ 2
Why my code dose not perform addition
var ans =Number(a)+Number(c); var a, b, c= prompt ("write equation", "", "", ""); if (b=="+") { alert ("your answer is "+ans); }else { alert("i am not program for this "); }
3 odpowiedzi
+ 6
You cannot have more then one input field in a prompt ,you have to use them seperately!
And before declaring a, b ,c, you can't use them ,it will be undefined.
https://code.sololearn.com/WkXnh1w0al0L/?ref=app
+ 5
Yup,you can use jQuery to achieve it.
Check this it will help you!
https://stackoverflow.com/questions/12909044/is-it-possible-to-give-multiple-input-box-in-prompt-alert-in-javascript
+ 1
Yes , i try it also ....but when i want to input all the equation in one line what's function can i use ?