function getIndex(area , context){
return Array.prototype.indexOf.call(area, context);
}
参考链接
Finding DOM node index
JavaScript DOM: Find Element Index In Container
mdn链接还未详细看,有案例
NodeList
function getIndex(area , context){
return Array.prototype.indexOf.call(area, context);
}
参考链接
Finding DOM node index
JavaScript DOM: Find Element Index In Container
mdn链接还未详细看,有案例
NodeList