Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9157483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:01:40+00:00 2026-06-17T13:01:40+00:00

Fixed my code up. However, now the alert pops up saying your value is

  • 0

Fixed my code up. However, now the alert pops up saying your value is NaN. However, it is a number. The parseInt, helped a little bit. I am most likely missing something. Right now my code looks like this:

    <input id="a" type="text">


    <script>
        function myFunction()
            {
                x=document.getElementById("a").value;
                if(x==""||isNaN(x))
                    {
                        alert("Your First Number is Not Numeric");
                    }
                a=document.getElementById("a").value;   
            }
    </script>   

    <button type="button" onclick="myFunction()">Submit Number</button>
    <br />
    <p>Second Number</p>
    <br />
    <input id="b" type="text">
    <script>
        function myFunction1()
            {
                x=document.getElementById("b").value;
                if(x==""||isNaN(x))
                    {
                        alert("Your Second Number is Not Numeric");
                    }
                b=document.getElementById("b").value;
            }
    </script>

    <button type="button" onclick="myFunction1()">Submit Number</button>
    <br />
    <script>
        function add()
            {
                d=parseInt(a);
                e=parseInt("b");
                c=d+e;
                alert("The number is " + c);
            }
    </script>
    <button type="button" onclick="add()">Add numbers</button>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:01:42+00:00Added an answer on June 17, 2026 at 1:01 pm

    Input values are strings. Use parseInt or another means of converting them to a number fore you try to add them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I fixed most of the problems for this, with help, however now when
I know this issue was posted before, and i fixed my code according to
My code contains a table that I need to have a fixed width. The
UPDATE - I have fixed some mistakes in the code below and the images
I'm using this code to center/position a fixed width image as my background. I
I currently have the following code which delays showing a fixed bar after a
I've just fixed a very subtle bug in our code, caused by slicing of
My code currently looks like this: <div style=position: fixed; width: 35.25%; height: 6.75%; left:
First off I use this code to make the navigation bar always stay fixed;
When I run the sample code below the width of JTextArea is fixed (100px)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.