中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

jQuery.isNumeric()方法

jQuery 雜項方法jQuery 雜項方法

實例

判斷輸入值類型

$(function () { function fun( html ){ document.body.innerHTML += "<br>" + html; } // true fun($.isNumeric( "-10" )); fun($.isNumeric( "0" )); fun($.isNumeric( 0xFF )); fun($.isNumeric( "0xFF" )); fun($.isNumeric( "8e5" )); fun($.isNumeric( "3.1415" )); fun($.isNumeric( +10 )); fun($.isNumeric( 0144 )); //false fun($.isNumeric( "-0x42" )); fun($.isNumeric( "7.2acdgs" )); fun($.isNumeric( "" )); fun($.isNumeric( {} )); fun($.isNumeric( NaN )); fun($.isNumeric( null )); fun($.isNumeric( true )); fun($.isNumeric( Infinity )); fun($.isNumeric( undefined )); })

運行代碼 ?

定義和用法

$.isNumeric() 函數(shù)用于判斷指定參數(shù)是否是一個數(shù)字值。

注意:在jQuery 3.0中,$.isNumeric()方法只有接收number類型的參數(shù),或者是可以被強制為有限數(shù)值的 string類型的參數(shù)時,才會返回true,否則返回false。


語法

$.isNumeric( value )
參數(shù) 描述
value 任意類型 需要進行判斷的任意值。

jQuery 雜項方法jQuery 雜項方法

其他擴展