I thought it was more on the lines of $(".total").val(tot) considering he
said the input had the class "total".
Michel Belleville
2009/11/13 Dan G. Switzer, II
> palgo:
>
> You probably mean:
>
> $("#total").val(tot);
>
> The selector $("total") would be looking for an element named total (i.e
palgo:
You probably mean:
$("#total").val(tot);
The selector $("total") would be looking for an element named total (i.e.
,) where as $("#total") looks for an element with an id of "total".
-Dan
On Fri, Nov 13, 2009 at 10:13 AM, palgo wrote:
> Hi guys,
>
> I have several input fields where t
While is a bad habit you may love to leave when you try the iterator
approach :
var tot = 0;
$('.part').each(function() { tot += $(this).val(); });
$('.total').val(tot);
And don't forget classes are accessed with a '.' (total lacked it's '.' in
your example).
Michel Belleville
2009/11/13 palgo
3 matches
Mail list logo