Search code examples
jqueryisnumeric

jQuery - Setting .blur to a class


I'm trying to set a blur on all 'number' classes (which happen to be tags).

My trial coding is;

$('.number').blur(function () {
        if ($.isNumeric($(this).val) == false) alert('false ' + $(this).val);
        else alert('true ' + $(this).val);
        }) ; 

It seems $(this) doesn't pick up the tag. Basically I want to be able to check whether the value is numeric of not.

Would be grateful any ideas/solutions to this problem.


Solution

  • val() is a function and should be called with brackets.