tags:

views:

46

answers:

1

I have generated inputs with price values.

Example: input type="text" value="59,00"

Now I should replace the , (comma) with a . (dot) with jQuery.

I tried this but it does not work: $('#inputid[value~=,]').each(function(i){ $(this).text($(this).text().replace(',','.')) });

Could you help me

+2  A: 
$('input:text').each(function() {
    var value = $(this).val();
    $(this).val(value.replace(/\,/i, '.'));
});
Darin Dimitrov