參考代碼中添加函數(shù)前后的Highlight()這個是什么意思?
window.onload = function(){
?? ??? ?Highlight();
?? ? } ?
?? ? function addOne(obj){
?? ???? ...........................
?? ??? ?Highlight();
? ??? ? }
window.onload = function(){
?? ??? ?Highlight();
?? ? } ?
?? ? function addOne(obj){
?? ???? ...........................
?? ??? ?Highlight();
? ??? ? }
2016-04-12
舉報
2017-08-04
Hightlight并不是函數(shù)名,而是個函數(shù)。這個問題我也在找答案,ls說的不對。
2016-04-12
參考的scrip代碼的最后一段,參考代碼定義了以下的函數(shù)Highlight(),你發(fā)的這段,就是在調(diào)用下面定義的這個函數(shù)。
function Highlight(){
var tbody = document.getElementById('table').lastChild;
trs = tbody.getElementsByTagName('tr'); ??
for(var i =1;i<trs.length;i++){
trs[i].onmouseover = function(){
this.style.backgroundColor ="#f2f2f2";
}?
trs[i].onmouseout = function(){
this.style.backgroundColor ="#fff";
}?
} ?
}