首页 > 其他 > 详细

5.25 问答练习

时间:2016-05-27 23:33:26      阅读:280      评论:0      收藏:0      [点我收藏+]
 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5 
 6 <title>5.25  姓名问答练习</title>
 7 </head>
 8 
 9 <body>
10 <form>
11 你叫什么名字?
12 <input type="text" value="" mingzi="岁月静好" id="1" />
13 <input type="button" value="检查" id="2" onclick="check()" />
14 </form>
15 </body>
16 </html>
17 <script>
18 function check()
19 {
20 var a=document.getElementById("1");
21 var b=a.value;
22 var c=a.getAttribute("mingzi");
23 if(b==c)
24 {
25 alert("回答正确");
26 }    
27 else
28 {
29 alert("回答错误")    ;
30 }
31 }
32 </script>

 

5.25 问答练习

原文:http://www.cnblogs.com/suiyuejinghao123/p/5536391.html

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