标签:
1.图片切换
function changeImage() { var img = document.getElementById("myImg"); if (img.src.match("1")) img.src = "img/2.jpg"; else img.src = "img/1.jpg"; }
2.判断是否数组
function isArray(myArray) { console.log(myArray.constructor.toString()); return myArray.constructor.toString().indexOf("Array") > -1; }
标签:
原文地址:http://www.cnblogs.com/zhengwk/p/5382349.html