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
本文标题:js获取index
本文链接:https://www.haomeiwen.com/subject/gffmrttx.html
网友评论