Is my way to right simple JavaScript DOM project is Correct?

Hello!,
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 any number.

@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 0.

My only other suggestion is to not use inline css for the errorMsg. Instead created classes with the desired styling and add the class to the element. This separates to styling from the html and allows you to just change the CSS class if you want to adjust the styling instead of having to go into the code. Plus, it reduces the JavaScript code clutter.

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.