HOME > > > > >

jQuery.isNumeric( value )

引数

value
mixed

戻り値

boolean

valueが数値として扱える場合true、それ以外はfalse

javascript

  1.  
  2. $.isNumeric( "-10" );     // true
  3. $.isNumeric( 16 );        // true
  4. $.isNumeric( 0xFF );      // true
  5. $.isNumeric( "0xFF" );    // true
  6. $.isNumeric( "8e5" );     // true (exponential notation string)
  7. $.isNumeric( 3.1415 );    // true
  8. $.isNumeric( +10 );       // true
  9. $.isNumeric( 0144 );      // true (octal integer literal)
  10. $.isNumeric( "" );        // false
  11. $.isNumeric({});          // false (empty object)
  12. $.isNumeric( NaN );       // false
  13. $.isNumeric( null );      // false
  14. $.isNumeric( true );      // false
  15. $.isNumeric( Infinity );  // false
  16. $.isNumeric( undefined ); // false
  17.