---
title: "Check any value numeric or non-numeric via jQuery"  
description: "Check any value numeric or non-numeric via jQuery"  
author: "Ethan Karla"  
published: 2021-07-28  
updated: 2023-11-27  
canonical: https://www.mindstick.com/forum/156659/check-any-value-numeric-or-non-numeric-via-jquery  
category: "jquery"  
tags: ["jquery"]  
reading_time: 2 minutes  

---

# Check any value numeric or non-numeric via jQuery

How to [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) any [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) numeric or non-numeric via jQuery?\

## Replies

### Reply by Aryan Kumar

To check if a value is numeric or non-numeric using jQuery, you can use a combination of the **$.isNumeric()** function. Here's an example:

```plaintext
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Check Numeric or Non-Numeric with jQuery</title>
  <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
</head>
<body>

<input type="text" id="inputValue" placeholder="Enter a value">
<button id="checkButton">Check</button>

<script>
  $(document).ready(function () {
    $('#checkButton').on('click', function () {
      // Get the input value
      var inputValue = $('#inputValue').val();

      // Check if the value is numeric using $.isNumeric()
      if ($.isNumeric(inputValue)) {
        alert(inputValue + ' is numeric.');
      } else {
        alert(inputValue + ' is non-numeric.');
      }
    });
  });
</script>

</body>
</html>
```

In this example:

- An **<input>** element is used to get a user's input.
- A **<button>** element triggers the check.
- The jQuery code is executed when the button is clicked.
- The **$.isNumeric()** function is used to check if the entered value is numeric.
- An alert is displayed based on whether the value is numeric or non-numeric.

Make sure to include the jQuery library in your HTML file for this to work. Adjust the code as needed for your specific use case.


---

Original Source: https://www.mindstick.com/forum/156659/check-any-value-numeric-or-non-numeric-via-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
