It is possible to read an input form with an existing mathematical formula and get the result?

We all know how to get different number values and then make calculations, but what if in the input form you write the formula, let’s say: 10 * 2, and you want to extract this information and get the result? It is possible to get this information so the Javascript can interpret this like an operation and do the calculation? How would you do it?

Also, to make it more complicate, what if you only have the operator and the second number, but have to get the first number from another div or input and add it?

I’m not sure if I have been clear. Thanks for the help.

Source: JavaSript – Stack Overflow

November 21, 2021
Category : News
Tags: forms | input | javascript | math

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.