Add an onmousedown event handler to the click. var trs = document.getElementById('table1').getElementsByTagName('tr'); var choose; window.onload = function(){ for( var i=0; i< ;trs.length; i ){
trs[i].onmousedown = function(){
tronmousedown(this);
}
}
}
function tronmousedown(obj) { for( var o=1; o if( trs[o] == obj ){ trs[o].style.backgroundColor = 'lightblue'; choose = o; } else{ trs[o].style.backgroundColor = ''; } } }
You can communicate together.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn