Table cell onmouseover action event : td « HTML Tags « JavaScript Tutorial

Home
JavaScript Tutorial
1.Language Basics
2.Operators
3.Statement
4.Development
5.Number Data Type
6.String
7.Function
8.Global
9.Math
10.Form
11.Array
12.Date
13.Dialogs
14.Document
15.Event
16.Location
17.Navigator
18.Screen
19.Window
20.History
21.HTML Tags
22.Style
23.DOM Node
24.Drag Drop
25.Object Oriented
26.Regular Expressions
27.XML
28.GUI Components
29.Dojo toolkit
30.jQuery
31.Animation
32.MS JScript
JavaScript Tutorial » HTML Tags » td 
21.14.3.Table cell onmouseover action event
<html>
<head>
<style type="text/css">
td.menu {font-family:Arial;
        font-weight:bold;
        background-color:blue;
        cursor:hand}
a{
    text-decoration:none;
    color:black;
}
</style>
<script language="javascript" type = "text/javascript">
<!--
function selectlink(currentDell,linkdesc){
    currentDell.style.background='yellow';

    if (document.getElementById)
      document.getElementById("selectdesc").innerHTML=linkdesc;
    else
      selectdesc.innerHTML=html;
}
function leavelink(currentDell){
    currentDell.style.background='blue';

    if (document.getElementById)
      document.getElementById("selectdesc").innerHTML='&nbsp;';
    else
      selectdesc.innerHTML='&nbsp;';
}
//-->
</script>
</head>
<body>
<table width=200>
<tr>
    <td class="menu" bordercolor="black"
        id="choice1"
        onmouseover="selectlink(this,'AAA')"
        onmouseout="leavelink(this)"">

           <a href="http://www.java2s.com">AAA</a>
    </td>
</tr>
<tr>
    <td class="menu" bordercolor="black"
        id="choice2"
        onmouseover="selectlink(this,'BBB')"
        onmouseout="leavelink(this)">

           <a href="http://www.java2s.com">BBB</a>
    </td>
</tr>
<tr>
    <td class="menu" bordercolor="black"
        id="choice3"
        onmouseover="selectlink(this,'CCC')"
        onmouseout="leavelink(this)">

           <a href="http://www.java2s.org/">CCC</a>
    </td>
</tr>
    <td class="menu" bordercolor="black"
        id="choice4"
        onmouseover="selectlink(this,'DDD')"
        onmouseout="leavelink(this)">

           <a href="http://www.java2s.com">DDD</a>
    </td>
</tr>
<tr>
    <td bordercolor="black" bgcolor="white" height="18">
      <font id="selectdesc" size="2"></font>
    </td>
</tr>
</table>
</body>
</html>
21.14.td
21.14.1.Set and clear table cell content
21.14.2.Change Table cell background color (IE)
21.14.3.Table cell onmouseover action event
21.14.4.Table cell onmouseout action event
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.