JS基础

xiaoxiao2021-02-28  82

数组:

function text10(){ var d=document.getElementById("a1"); d.style.color="#F0F"; d.style.fontFamily="宋体"; if(d.style.float=="right"){ d.style.float="left"; }else{ d.style.float="right"; } d.style.fontSize="200px"; } function text11(){ alert(isNaN("2")); alert(isNaN("2134")); alert(isNaN(2)); alert(2==="2"); alert(2=="2"); alert(isNaN("qew")); } function text12(){ var v=document.getElementById("input1"); if(isNaN(v.value)){ alert("请输入数字"); } } function text13(){ document.getElementById("p1").innerHTML="爱上对方过后就哭了"; } function text14(){ var x=1,y=2,z=x+y; alert(z); } function text15(){ var x=new Array(3); x[0]="dfg"; x[1]="hj"; x[2]="mb"; for(var i=0;i<x.length;i++){ alert(x[i]); } } function text16(){ var date1=new Date(); var a=document.getElementById("date"); a.innerHTML="当前时间:"+date1.getFullYear()+"年"+(date1.getMonth()+1)+"月"+date1.getDate()+"日"+date1.getHours()+":"+date1.getMinutes()+":"+date1.getSeconds(); } setInterval("text16()",1000); var p={ pname:"hhhh", pid:"123456" } function text17(){ alert(p.pname); } var asdfghj = "sdfg hjk"; document.write(p.pname); document.write(asdfghj.length); var zeze = asdfghj.split("",3); document.write(zeze); function testa(){ var a=new Object(); a.anme="jjkk"; a.aid=1; } <div align="center"> <span id="span1" οnclick="text6()">哈哈哈</span> <br/> <input type="button" value="点我呀!" class="a1" οnclick="text2()"/> <br/> <input type="button" value="点我呀!点两下" class="a2" οndblclick="text5()"/> <br/> <input type="button" value="点我呀!点两下" id="name" class="a2" οnclick="text4()"/> <br/> <img src="3.jpg" id="img2" οnclick="text5()" title="222"/> <br/> <img src="1.jpg" id="img3" οnclick="text9(this.src)" style="height:300px;width:300px" title="222"/> <br/> <img src="1.jpg" id="img4" οnclick="text8()" style="height:300px;width:300px" title="222"/> <a οnclick="text11()" style="font-size:50px;">健康快乐</a> <input type="text" id="input1"/> <input type="button" value="点击这里" οnclick="text12()"/> <textarea id="p1" οnclick="text13()">规划及会计</textarea> </div> <a id="a1" οnclick="text10()" style="font-size:50px;">健康快乐</a> <a οnclick="text14()">hhhhh</a> <p id="date">3456789</p>

转载请注明原文地址: https://www.6miu.com/read-84586.html

最新回复(0)