HTML
<input type='text' id='costs' value='100' size='3'></input>
JQuery
var costs = $("#costs");
var c = parseFloat(costs.val().replace(",",".")); //germany ;)
costs.text(c);
If I leave the input field empty I get NAN. What do I have to change to replace the input field with a 0 if it is empty?
1 Answer