Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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;
}
Comment

calculate two number and diplay next field without reload the page javascript

<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">
Comment

PREVIOUS NEXT
Code Example
Javascript :: load new site with javascript 
Javascript :: push values to data object in vue 
Javascript :: javascript check if consecutive array 
Javascript :: connect node server with knex database 
Javascript :: date string to date in js 
Javascript :: react loop 
Javascript :: redux saga fetch data 
Javascript :: You provided a `value` prop to a form field without an `onChange` handler 
Javascript :: mongoose nested object without id 
Javascript :: change all a tag href javascript 
Javascript :: jquery get table to object 
Javascript :: javascript debugging exercises 
Javascript :: Uncaught TypeError: theme.spacing is not a function 
Javascript :: vue router transition 
Javascript :: variable javascript 
Javascript :: function prototype in javascript 
Javascript :: javascript trim whitespace 
Javascript :: vue boolean 
Javascript :: javascript save data to local storage 
Javascript :: js session storage 
Javascript :: jquery datatable draw false 
Javascript :: overflowy 
Javascript :: react window.addEventListener 
Javascript :: javascript remove css link 
Javascript :: add and remove class in jquery 
Javascript :: css select all links in div 
Javascript :: check if all values in array are zero javascript 
Javascript :: fade in onscroll jquery 
Javascript :: new line in javascript string 
Javascript :: closest js 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =