5.22
遞歸:程序調(diào)用自身的編程技巧稱為遞歸( recursion)。
造標(biāo)簽
var spn = document.createElement("span");
spn.style.color="";
spn.innerText = "字字字字字pendChild(spn);
document.getElementById("").appendChild(spn);
document.getElementById("").removeChild(spn);
?
設(shè)置屬性
var btn = document.getElementById("btn");
// alert(btn.getAttribute('value'));
btn.onclick = function(){
btn.setAttribute("value","");
}
判斷閏年
if((yeared % 100 != 0 && yeared % 4 == 0) || yeared % 400 == 0){}
?
判斷一個(gè)數(shù)據(jù)是否是數(shù)組中
可以用數(shù)組的indexOf函數(shù),方法arr.indexOf(find,start);
find:要找的內(nèi)容,必須;
start:查找開始下標(biāo),可選;
返回:查找數(shù)據(jù)所在的下標(biāo),如果沒找到,返回-1
如果只要知道是否有8這個(gè)數(shù)字,直接調(diào)用arr.indexOf(8),如果返回值不為-1,說明找到了。
轉(zhuǎn)載于:https://www.cnblogs.com/niez1/p/6890063.html
與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
- 上一篇: web端 复合控件 响应回发
- 下一篇: hibernate 表关系映射详解之继承