td.cellIndex td.parentElement.rowIndex tr.rowIndex<table border> <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> </table> <script> function document.onclick(){ var e=window.event.srcElement if(e.tagName=="TD"){ window.status="第"+(e.parentElement.rowIndex+1)+"行,第"+(e.cellIndex+1)+"列" } } </script>如果你要鼠标移动效果,就将上面的click改为mouseover或mousemove
td.parentElement.rowIndex
tr.rowIndex<table border>
<tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr>
<tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr>
<tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr>
<tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr>
<tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr>
</table>
<script>
function document.onclick(){
var e=window.event.srcElement
if(e.tagName=="TD"){
window.status="第"+(e.parentElement.rowIndex+1)+"行,第"+(e.cellIndex+1)+"列"
}
}
</script>如果你要鼠标移动效果,就将上面的click改为mouseover或mousemove
看这里把
http://www.5meng.com/viewlesson.asp?contentID=1022