<input >

 

<script>

   function my_function(){

    var x = document.getElement.ById("domo").value;

    if (x==""||isNaN(x))

  {

    alert("alarm");

  }

}

</scrit>

 

说明:

isNaN() 函数用于检查其参数是否是非数字值。

 

获取text的value,对值进行判断,

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-06-06
猜你喜欢
  • 2021-11-01
  • 2021-12-22
  • 2021-12-13
  • 2021-07-11
  • 2021-12-12
  • 2021-08-27
  • 2021-09-26
相关资源
相似解决方案