实现姓名和学号每隔一秒钟互换的效果

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6      <!--引入框架-->
 7     <link href="resource/bootstrap/css/bootstrap.css" rel="stylesheet">
 8     <script src="resource/jQuery/jquery-1.11.3.js"></script>
 9     <script src="resource/bootstrap/js/bootstrap.js"></script>
10
11     <!--引入自己的js-->
12     <script src="js/demo1.js"></script>
13
14     <style>
15         /*css选择器:class,id,标签,复合选择器*/
16     </style>
17 </head>
18 <body>
19     <script>
20     //每隔一秒钟学号和姓名互换
21     var i = 0;
22     window.onload=change;
23     setInterval(‘change()‘,1000);
24     function change()
25     {
26        if(i%2)
27        {
28           document.getElementById("result").innerHTML=‘姓名:张三‘;
29        }else
30        {
31           document.getElementById("result").innerHTML=‘学号:0303003‘;
32        }
33        i++;
34     }
35     </script>
36     <div id="result"></div>
37
38
39 </body>
40 </html>
时间: 2024-08-24 16:03:36

实现姓名和学号每隔一秒钟互换的效果的相关文章

每隔10秒钟打印一个“Helloworld”

/** * 每隔10秒钟打印一个"Helloworld" */ public class Test03 { public static void main(String[] args) throws InterruptedException { ThreadImp threadImp = new ThreadImp(); Thread thread1 = new Thread(threadImp); thread1.start(); } } class ThreadImp extend

字符串数组 输入3个字符串,要求按由小到大的字母顺序输出; 输入n个学生的姓名和学号到字符串数组中,在输入一个姓名,如果班级有该生则返回其信息,否则返回本班无此人

输入3个字符串,要求按由小到大的字母顺序输出 如 输入franch england china,输出结果是china england franch 三个数排序输出,比较三个数的大小怎么做? a=18 b= 9 c=30 a>b 交换 a=9 b=18 可不可以用选择法?可不可以用冒泡法?但是这里用不着 例题: string1 string2 string3 temp a=18 b= 9 c=30 b>c? 交换 b中放的是b 和 c 中小的数,c中放的是bc中大的数. 如果a<b,则输出

shell每隔一秒钟就记录下netstat状态

说明 木马可能类似随机发送心跳包的操作,随机sleep.对这类情况写好了一个监听shell脚本,每隔一秒钟就记录下netstat状态. 代码 #!/bin/bash #功能:用于定时执行lsof 和 netstat 的执行状态并记录到文件 slptime=1 #默认一秒执行一次 filedir=/tmp #默认存储在/tmp下 lsoffile=lsof.log #存储lsof的执行结果 netstatfile=netstatfile.log #存储netstat执行结果 while true

一班里有n个学生,把各学生的姓名及学号输入并储存,再输入一个学生姓名后查找,看是否有此学生。

#include <iostream> #include <string> using namespace std; string name[50],num[50]; int n; int main() { void input_date(); void search(string find_name); string find_name; cout<<"请输入本班学生的人数 :"; cin>>n; input_date(); cout&

通过javacv对视频每隔1秒钟截取1张图片

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:274) at org.bytedeco.javacpp.Loader.load(Loader.ja

ping命令脚本实现显示网络状态、学生姓名、学号

#!/bin/bash a=192.168.223. ####定义一个固定变量 h=(wanghao xieyunshen 刘桃) ####定义数组 for d in {101..254} ####for循环,后面的in是条件即从多少循环到多少 do ####for循环结构体 f=`expr $d - 100 ` ####把d变量减去100,作为我们的学号 g=`expr $f - 1 ` ####因为数组是从0开始,所以我们把学号减去1作为数组的标记 q=`printf %02d $f` ##

两个线程每隔一秒钟交替打印5个数

package test.thread; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class ExecutorTest { private static int i=0; private static final int PRINT_COUNT=5; private static final int CYCLE_COUNT=50; private stat

(4)一个学生的信息是:姓名,学号,性别,年龄等信息,用一个链表,把这些学生信息连在一起, 给出一个age, 在些链表中删除学生年龄等于age的学生信息。

#include "stdio.h"#include "conio.h"#include "stdafx.h"#include <iostream>using namespace std;struct stu{ char name[20]; char sex; int no; int age; struct stu * next;}*linklist; struct stu *creatlist(int n){ int i; //h为

50个查询系列-第六个查询:查询学过“001”并且也学过编号“002”课程的同学的学号、姓名

查询学过"001"并且也学过编号"002"课程的同学的学号.姓名: 我的写法: 第一步:先查出来学过"001"并且也学过编号"002"课程的同学的学号: SELECT t11.t1sid t33id FROM (SELECT t1.StuId t1sid FROM tblscore t1 WHERE t1.CourseId='001')t11,-- 001的学生的id (SELECT t1.StuId t2sid FROM t