Breaking News
Loading...
, , ,

onkeyup with javascript like ajax

Share on Google Plus

onkeyup with javascript like ajax


Sample Code:

...................................................................................................................................................................<script>
function balance(str) {   
  var val = str;
// this fucntion reduce the value by 100 and show the result in result text box  
  var result = 100 - val;   
 document.getElementById("bal_show").value =result;
}
</script>
...................................................................................................................................................................


<div class="first">
            <label for="">balance</label>
//onkeyup() function is used to send the each value to that function on every key press
                <input type="text" id="receipt" onkeyup="balance(this.value)">
            <label for="">result</label>
//here is the result textbox this ll show the balance without any submit button or without any action //like ajax.
              <input type="text" id="bal_show" >
</div>
...................................................................................................................................................................

You Might Also Like

0 comments

About me


Like us on Facebook