在JavaScript代码中,可以使用window对象的alert()函数来显示一段文本.

<input type="button" onclick="fun(this.id)" id="a" class="btn btn-main btn-lg" value = "再次统计">
<script>
            function fun(id){
                var s = document.getElementById(id).value;
                alert(s+"我被点击了");
            }
        </script> 
        

页面效果:

javascript调用alert()

 

相关文章:

  • 2021-12-30
  • 2021-05-28
  • 2022-01-09
  • 2022-12-23
  • 2021-09-16
  • 2022-02-28
  • 2022-12-23
  • 2021-09-14
猜你喜欢
  • 2021-11-11
  • 2021-06-20
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案