How to check if number is numeric while using jquery 1.7+? : jquery mobile



How to check if number is numeric while using jquery 1.7+? : jquery mobile..

Answer / Santosh Kumar Tyagi

You can use the jQuery `isNumeric()` function to check if a string is a number. Here's an example:

```javascript
function isNumeric(num) {
if (typeof num !== 'string') return false;
return !isNaN(parseFloat(num)) && isFinite(num);
}

// Usage
if (isNumeric($.trim(inputValue))) {
// Number is valid
} else {
// Number is not valid
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

What are the types of selectors in jQuery?

1 Answers  


How to use migrate jQuery plugin?

1 Answers  


What are your tools of choice to get the jquery job done?

1 Answers  


Which command will give a version of jQuery?

1 Answers  


What are selectors in jquery? : jQuery Mobile

1 Answers  


Differentiate the concepts of .js and .min.js?

1 Answers  


How do you install/use jquery in a project.

1 Answers  


Explain the term method chaining? : jQuery Mobile

1 Answers  


How can jquery library be added to pages?

0 Answers  


How to get/set the html contents of an element using jQuery?

1 Answers  


Is jquery html() method works for both html and xml documents?

1 Answers  


What is jquery selectors? Give some examples.

1 Answers  


Categories