.val problem

.val problem

Hi,

I have the following:

$('td').keyup(function() {
                       for(i=0; i<1; i++) {
                          total = $('#sellshippingvat').val() ;
                          alert(total) ;
                       }
                    $('#purtot').text(total);
                         }) ;

The form field is a text input field with the id/name of sellshippingvat.

But it is not getting the value like it should, what is wrong?