星星评分与显现

星星评分与展现var box document.getElementById(box)box.onmouseover function(e){var e e || w

星星评分与展现

var box = document.getElementById('box');box.onmouseover = function(e){            var e = e || window.event;            var target = e.srcElement || e.target;            var tagName = target.tagName.toUpperCase();            if(tagName == 'B'){                var j = 1;                target.style.backgroundPosition = '0 -18px';                var nd = target.previousSibling;                while(nd && nd.tagName == target.tagName){                    nd.style.backgroundPosition = '0 -18px';                    nd = nd.previousSibling;                    j++;                }                nd = target.nextSibling;                while(nd && nd.tagName == target.tagName){                    nd.style.backgroundPosition = '0 0';                    nd = nd.nextSibling;                }                document.getElementById('score').innerHTML = j;            }        }