How to properly write the function for a button | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to properly write the function for a button

Please look at the JavaScript for my attached code here. My question is, how is it best to have the function for the submit button on my app? Should I have the function only do the final equation when submit is clicked, and all of the other stuff is called beforehand? Or should it be how I currently have it? My concern is that it won’t pull the info for getElementById() if it is not part of the submit button’s function. And also, what is considered proper for a calculator like this? Any input is appreciated! https://code.sololearn.com/Wff2HPhJ1CS8/?ref=app

26th Sep 2019, 3:57 AM
Jason Thomas
Jason Thomas - avatar
3 Answers
+ 3
It is good why to do it properly write the function for a button . It is in proper way
26th Sep 2019, 4:15 PM
Abhishek Roy
Abhishek Roy - avatar
+ 3
Thanks bro
26th Sep 2019, 4:31 PM
Abhishek Roy
Abhishek Roy - avatar
+ 1
Do u have any idea about mobile programming
26th Sep 2019, 4:33 PM
Abhishek Roy
Abhishek Roy - avatar