Syntax error. Help with one small JS snippet :(

Posted by Bogdan on Stack Overflow See other posts from Stack Overflow or by Bogdan
Published on 2010-06-09T10:25:40Z Indexed on 2010/06/09 10:32 UTC
Read the original article Hit count: 194

Filed under:
|

Hey guys. I don't know much JS, but I wanted to do some quick work with jQuery.

But I've been staring at this for about an hour and I don't understand what I missed:

<script type="text/javascript">
    $('#qty_6035').change(function () {
        var substractedQty, stockQty, remQty;
        substractedQty = (int) $('#qty_6035').val(); // missing ; before statement 
        stockQty = (int) $('#orig_qty_6035').val();
        $('#rem_qty_6035').html(stockQty-substractedQty);
    });
</script>

jQuery library is included at the beggining of the document.

Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery