当前位置:   article > 正文

jsp代码实例第260课_jsp中function greet的练习

jsp中function greet的练习

code260.jsp

  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>javascript</title>
  8. <script type="text/javascript">
  9. function greet() {
  10. var name = document.getElementById("name");
  11. if (name)
  12. {
  13. window.alert("hello " + name.value);
  14. }
  15. }
  16. </script>
  17. </head>
  18. <body>
  19. <input type="text" id="name"><br>
  20. <input type="button" value="hello" onclick="greet()">
  21. </body>
  22. </html>

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/289755
推荐阅读
相关标签
  

闽ICP备14008679号