在不使用jQuery的情况下,按标签名称获取最接近的元素的方法如下:function getClosest(el, tag) { // this is necessary since nodeName is always in upper case tag = tag.toUpperCase(); do { if (el.nodeName === tag) { // tag name is found! let's return it. :) return el; } } while (el = el.parentNode); // not found :( return null;}getClosest(th, 'tbody');