0

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.

Simon R
  • 3,732
  • 4
  • 31
  • 39

2 Answers2

1

val is a function.

$(this).val

should be

$(this).val()
Dutchie432
  • 28,798
  • 20
  • 92
  • 109
0

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

Stefan
  • 5,644
  • 4
  • 24
  • 31