1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Document</title>6 <!--Introducing Frames -7 <Linkhref= "Resource/bootstrap/css/bootstrap.css"rel= "stylesheet">8 <Scriptsrc= "Resource/jquery/jquery-1.11.3.js"></Script>9 <Scriptsrc= "Resource/bootstrap/js/bootstrap.js"></Script>Ten One <!--Introduce yourself to JS - A <Scriptsrc= "Js/demo1.js"></Script> - - <style> the /*CSS selector: class,id, tags, composite selector*/ - </style> - </Head> - <Body> + <Script> - //every second of the school number and name interchange + varI= 0; A window.onload=Change ; at SetInterval ('Change ()', +); - functionChange () - { - if(i%2) - { - document.getElementById ("result"). InnerHTML='Name: Zhang San'; in }Else - { to document.getElementById ("result"). InnerHTML='School Number: 0303003'; + } - I++; the } * </Script> $ <DivID= "Result"></Div> Panax Notoginseng - the </Body> + </HTML>
Achieve the effect of exchanging names and school numbers every second