点名表

版权声明:本文为郝云原创文章,未经郝云允许不得转载。 https://blog.csdn.net/haoyunyun888/article/details/51459589

课堂点名表

<meta charset="utf-8">
<html>
<title>点名表</title>
<fieldset style="color: blue">
    <legend><h2>班级点名表</h2></legend>
    <h1>点名表</h1>
    <h3><textarea id="student"></textarea></h3>
    <input type="button" onclick="fun1();" value="点击" id="one">
</fieldset>
</html>
<script>
    //点名表
    document.bgColor='green';
    function fun2(){
        var arr=Array('');
        var num=parseInt(Math.random()*arr.length);
        document.getElementById('student').innerHTML=arr[num];
    }
    function fun1(){
        if(document.getElementById('one').value=='开始'){
            document.getElementById('one').value='停止';
            a=setInterval("fun2();",10)
        }else{
            document.getElementById('one').value='开始';
            clearInterval(a);
        }
    }
</script>

猜你喜欢

转载自blog.csdn.net/haoyunyun888/article/details/51459589
今日推荐