<script>// alert( detectNum('123456') );var aInp = document.getElementsByTagName('input');aInp[1].onclick = function () {var val = aInp[0].value;if ( detectNum(val) ) {alert( '恭喜,'+ val +'全是数字'
通过break结束for循环 for(var i=1;i>=0;++i){ if(i>100){ break;//结束for循环 } document.write(i+'<br/>'); } document.write('<hr color="red"/>'); /* continue:代
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>无标题文档</title><script>// alert(a);// ...alert( fn1 );// F火
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>无标题文档</title><script>window.onload = function (){ var aIn
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>无标题文档</title><script>// JS中的数据类型:数字(NaN)、字符串、布尔、函数、对象(obj
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <script> /* 显式类型转
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <script> /* ECMAS
一、 <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <script> //&nb
document.titile="简介"; //修改文档的标题为“简介”document.body.innerHTML="<p>document的属性和方法</p>"; //修改文档的内容为“简介”
文档中查找元素的基本方法
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号