第二十天

Posted 马MZJ

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第二十天相关的知识,希望对你有一定的参考价值。

两个小练习

 1 <body>
 2 <form>
 3     <input type="text" id="a1" daan="1949"  />
 4     <input type="button" value="提交" onclick="aa()" />
 5     <input type="button" value="同意10" id="a2" disabled="disabled" />
 6 </form>
 7 </body>
 8 </html>
 9 <script>
10 function aa()
11 {
12     var a = document.getElementById("a1");
13     var b = a.getAttribute("daan");
14     var c = a.value;
15     if(b==c)
16     {
17         alert("正确");
18     }
19     else
20     {
21         alert("错误");
22     }
23 }
24 var n = 10;
25 function aaa()
26 {
27     var a = document.getElementById("a2");    
28     n--;
29     if(n == 0)
30     {
31         a.value = "同意";
32         a.removeAttribute("disabled");
33     }
34     else
35     {
36         a.value = "同意" + n;
37         window.setTimeout("aaa()",1000); 
38     }
39 }
40 window.setTimeout("aaa()",1000);
41 </script>

第一个是对比答案是否正确,第二个是倒计时。

以上是关于第二十天的主要内容,如果未能解决你的问题,请参考以下文章

第二次冲刺第十天

第二十天:继承

安卓第十天笔记-fragment

学习Python的第二十天三级菜单高级版

爱创课堂每日一题第二十天- 谈谈性能优化问题?

Java自学笔记第二十天