函数代码: 代码如下: 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 [removed] document.getElementByIdx_x=function(id){ if(typeof id ==’string’) return document.g