Skip to main content
2 of 2
spelling
Jason Aller
  • 3.7k
  • 28
  • 43
  • 40

How to write 0 as first character in input type text field

I have an input field and I am putting value in it dynamically so I am getting 01 value to put in the text box

$('#final_result').val(open+close); 

I have an input field which id is final_result and I am getting 0 in open and 1 in close as a number. I try to convert it into string like

$('#final_result').val(toString(open)+toString(close)); 

but still getting 1 in input I want 01 in input field.

vivek modi
  • 497
  • 1
  • 6
  • 20