When the user types a value in an edit box or selects a value from a text-based control, the value is considered a simple group of words and the browser may not be able to identify or categorize what exists in a text-based control. The parsetInt() function is used to check what is in a text-based control. Its syntax is:
parseInt(Value)
When calling this function, you must provide the argument. If the value is a natural number, parseInt() returns that number. For example, if you call it as
parseInt("124")
the function will return 124. When program finds a character that is not a digit, it would stop. It would then convert to number the digits found on the left side of the first non-digit character. For example, if you call it as
parseInt("216PLL")
the function would return 216.
0 Comment(s)