1.
var g =function(id){
if(id.substr(0,1)==‘·‘)
{
return document.getElementByClassName(id.substr(1));
}
return document.getElementById
(id);}
2.
function $(id)
{return typeof id==='string'?document.getElementById
(id):id;}
這兩個(gè)通用函數(shù)的意義不一樣在哪,麻煩解釋詳細(xì)一點(diǎn),謝謝
qq_一夢兩三年丶_0
2017-01-16 18:27:01