I don't get it why is this not working properly:

[Fiddle](https://jsfiddle.net/ze5tsgy9/1/)

I just want to show the tax amount but it gets `false` results.

```
// calculate brutto and tax
$(document).on('keyup paste', '#netto', function() {
    var brutto = $("#brutto").val();
    var netto = $("#netto").val();
    $("#brutto").val(netto * 1.19);
    $("#tax").val(brutto - netto);
});

```
['https://Stackoverflow.com/questions/41160023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2502731/']
The problem is that you get the brutto value before filling it, the solution is to get `var brutto` after you calculate `$("#brutto").val(netto * 1.19)`:

```js
// calculate brutto and tax
$(document).on('keyup paste', '#netto', function() {
    var netto = +$("#netto").val();
    $("#brutto").val(netto * 1.19);
    var brutto = +$("#brutto").val();
    $("#tax").val(brutto - netto);
});
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="form-group">
    <label for="brutto">Brutto</label>
    <input class="form-control" readonly="readonly" name="brutto" type="text" id="brutto">
</div>
<div class="form-group">
    <label for="tax">Taxes 19%</label>
    <input class="form-control" readonly="readonly" name="tax" type="text" id="tax">
</div>
<div class="form-group">
    <label for="netto">Netto</label>
    <input class="form-control" name="netto" type="text" id="netto">
</div>
```
Parse you strings to int, change the event to a input type event:

```
 $(document).on('input', '#netto', function () {

  var brutto = parseInt($("#brutto").val());
  var netto = parseInt($("#netto").val());

  $("#brutto").val(netto * 1.19);
  $("#tax").val((netto * 1.19) - netto );

});

```

better if you go with a input type number so you don't have problems with invalid values

<https://jsfiddle.net/ze5tsgy9/6/>
or:

<https://jsfiddle.net/ze5tsgy9/7/> if you want to get rid of NaN when its empty