calculate two number and diplay next field without reload the page javascript
var text1 = document.getElementById("Text1");
var text2 = document.getElementById("Text2");
function add_number() {
var first_number = parseFloat(text1.value);
if (isNaN(first_number)) first_number = 0;
var second_number = parseFloat(text2.value);
if (isNaN(second_number)) second_number = 0;
var result = first_number + second_number;
document.getElementById("txtresult").value = result;
}<p>Enter First Number :</p>
<br>
<input type="text" id="Text1" name="TextBox1" oninput="add_number()">
<br> <p>Enter Second Number :</p>
<br>
<input type="text" id="Text2" name="TextBox2" oninput="add_number()">
<br>Result :
<br>
<input type="text" id="txtresult" name="TextBox3">
Also in JavaScript:
- python format json file
- jquery animation
- capitalize algorithm
- jquery parse html
- new date parameters javascript
- javascript get current month start and end date
- how to extract values from array in javascript
- send random memes discord.js
- javascript sort alphabetically
- array chunk javascript
- react native dropdown
- javascript troubleshooting with jest
- greater than x but less than y es6
- what is ... in javascript
- jquery set hidden field value
- remove backslash in json array javascript
- keyboard key codes
- how to change background image dynamically in react
- set timer
- indexof javascript duplicate arrays
- javascript check if empty
- how to transpose json data
- how to add okta api to vuejs
- .env file example react native