首页 > Web开发 > 详细

js中判断数据类型的方法 typeof

时间:2017-06-25 18:17:07      阅读:238      评论:0      收藏:0      [点我收藏+]
  <input type="text" onblur="demo(this)"/><br/>
  <input type="number" onblur="demo(this)" /><br/>
  
  <script>
		function demo(obj){
			alert(obj.value+"  数据类型是  "+typeof(obj.value));
			alert("str"+"  数据类型是  "+typeof("str"));
			alert(111+"  数据类型是  "+typeof(111));
		}
  </script>
  

  

js中判断数据类型的方法 typeof

原文:http://www.cnblogs.com/1020182600HENG/p/7077274.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!