I am coding with freecodecamp. I am learning DOM. This is my simple project. Can you please suggest me if this is the correct way to write the project? Can you please suggest me the better way to right?
here is my project.
Thank you very much in advance.
If I enter the value
5.2 nothing happens when I click submit. What should the user see in this situation? I expected to see
27.04. If you only expect integers to be entered, that should be noted in the app’s instructions instead of
@RandellDawson Thank you very much. I change parseInt to parseFloat and it works. Thank you very much.
Why do you not allow the user to enter
0? The square of
0 is just
Thank you very much. I am working on this. After I finished I will post here again. Thank you very much for your suggestions. I want to validate the input without using REGEX for a moment. I am going to do it soon and let you know. Thank you.
You already are not using REGEX.
I did like if (isNaN(userNumber)), It works, But not sure if this is the standard way to validate without using REGEX .
I think that approach is fine.