几个简单的jscript问题,请大家帮忙

dancer 2004-10-08 08:17:53
1.如何使得鼠标移到table上时变成手型?

2.如何使点击table上某一行的tr的bgcolor变为蓝色,字变为白色,其他行不变

3.如何得到点击的是哪一行?(rows返回的是什么?),如何取得数据?

4.一个页面里有两个htm,如果在左边的htm的按钮控制右边htm的table?(例如删除一行)

5.打开一个新窗口,选择行后如何将此行的数据返回给原先的窗口?(用户名,用户id)

谢谢大家,分不够我加,很急,多谢了
...全文
171 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
baek7 2004-10-10
  • 打赏
  • 举报
回复
UP
hj3793 2004-10-09
  • 打赏
  • 举报
回复
up
guoweidong 2004-10-09
  • 打赏
  • 举报
回复
添加table的行和单元格.

row1 = tb.insertRow();
cell1 = row1.insertCell();
guoweidong 2004-10-09
  • 打赏
  • 举报
回复
如何删除table的行.

function RemoveRow()
{
//保留第一行表头,其余数据均删除.
var iRows = tb.rows.length;
for(var i=0;i<iRows-1;i++)
{
tb.deleteRow(1);
}
}
aoenzh 2004-10-09
  • 打赏
  • 举报
回复
this.style.cursor="hand"
micker 2004-10-09
  • 打赏
  • 举报
回复
1.如何使得鼠标移到table上时变成手型?
<table onMouseOver="this.style.cursor='hand'" onMouseOut="this.style.cursor='default'">

2.如何使点击table上某一行的tr的bgcolor变为蓝色,字变为白色,其他行不变
<tr onClick="this.style.background='#CCFFCC';this.style.color=''" onMouseOut="this.style.background='';this.style.color='black'">

3.如何得到点击的是哪一行?(rows返回的是什么?),如何取得数据?
<tr onClick="alert(this.rowIndex)">

dancer 2004-10-08
  • 打赏
  • 举报
回复
多谢多谢,等待ing
guoweidong 2004-10-08
  • 打赏
  • 举报
回复
用javascript可以完全控制页面中的代码.想怎么样改就怎么样改.等我先把手上的事件做完帮你搞定.
guoweidong 2004-10-08
  • 打赏
  • 举报
回复
<table width="100%" border="1">
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
<tr>
<td onMouseOver="this.style.background='#CCFFCC';this.style.cursor='hand'" onMouseOut="this.style.background='';" onClick="alert(this.innerHTML)"> </td>
</tr>
</table>
Schnaufer 2004-10-08
  • 打赏
  • 举报
回复
一次问这么多?这些都好简单.

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧