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

  • SEARCH
  • Home
  • 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 8394237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:00:16+00:00 2026-06-09T20:00:16+00:00

I have one input text where the value is 5+3 I believe this is

  • 0

I have one input text where the value is “5+3” I believe this is a plain string, is there anyway to parse it as (8) in a alert() function? 5 + 3 is a value of one textbox and its not separated by another textbox. Is there any javascript function can handle this?

  • 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-09T20:00:17+00:00Added an answer on June 9, 2026 at 8:00 pm

    eval() can execute strings as JavaScript statements:

    <input type="text" id="addNums" />
    var addNumsInput = document.getElementById('addNums'),
        val = addNumsInput.value;
    
    alert(eval(val));
    

    Fiddle: http://jsfiddle.net/LAwm3/

    Just for your reference, eval is evil https://www.google.com/#hl=en&sugexp=les%3B&gs_nf=1&tok=WiRGhtSngs9KeYHImoAsFQ&cp=6&gs_id=3e&xhr=t&q=eval+is+evil&pf=p&output=search&sclient=psy-ab&oq=eval+i&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=2aae9199cf6ab275&biw=1920&bih=989

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

Sidebar

Related Questions

I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
I have three input text boxes in my form. First one is teacher, second
I have an input field which has a placeholder text. I want one word
I have one input field and one division with span children <input type=text id=input
I have a PL/pgSQL function which requires one input parameter which is the primary
Here is the situation, I have one input box and one text area on
I have a table with three columns. One with an input text box and
I have an ASP.NET form with three text inputs, one each for Work Phone,
i have one form which have some input box and some select box. i
I have two arrays and I post the arrays in one input; <input name='sistem[]'

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.