输入banner图图片脚本导航/分类

getElementByIdx_xjs自定义getElementById函数_javascript技巧

函数代码:
代码如下:

document.getElementByIdx_x=function(id){
if(typeof id =='string')
return document.getElementById(id);
else
throw new error('please pass a string as a id!')
}

实例代码:
代码如下:

9