开发者

How do i change table content on mouse over? [closed]

开发者 https://www.devze.com 2023-02-20 04:55 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so th开发者_开发技巧at it can be reopened, visit the help center. Closed 11 years ago.

What can i do this in and how?


Here's a simple little example for you:

<html>
<head>
<script>
function changeTDContents(text)
{
    document.getElementById("cell").innerHTML = text
}
</script>
</head>
<body>
<table onmouseover="javascript:changeTDContents('world!');" onmouseout="javascript:changeTDContents('Hello');">
<tr><td id="cell">Hello</td></tr>
</table>
</body>
</html>

Should be fairly self-explanatory.


JQuery mouseover event handlers will let you set the contents of any HTML element.

http://api.jquery.com/mouseover/ - the example here uses DIV elements but you should be able to shift it to use a table

0

精彩评论

暂无评论...
验证码 换一张
取 消