0

I have used document.getElementByID("textboxname").value to compare but it checks character by character as it considers integer value a string value.

I like to know how to convert document.getElementByID("textboxname").value string notation to integer notation so that it will be easy to compare integer values.

Thanks in advance

2 Answers2

0

use parseInt("your string") to convert it into valid integer

Vinod Louis
  • 4,812
  • 1
  • 25
  • 46
0

Use parseInt(document.getElementByID("textboxname").value, 10);

sohel khalifa
  • 5,602
  • 3
  • 34
  • 46