<HTML>
<HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE type=text/css>BODY {
BACKGROUND: white; COLOR: black; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px
}
.tableData {
BACKGROUND: white; BORDER-BOTTOM: white 1px dashed; BORDER-LEFT: white 1px dashed; BORDER-RIGHT: white 1px dashed; BORDER-TOP: white 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px
}
.tableDataSel {
BACKGROUND: #6090d0; BORDER-BOTTOM: #6090d0 1px dashed; BORDER-LEFT: #6090d0 1px dashed; BORDER-RIGHT: #6090d0 1px dashed; BORDER-TOP: #6090d0 1px dashed; COLOR: white; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px
}
.tableDataHit {
BACKGROUND: #d0e0ff; BORDER-BOTTOM: #d0e0ff 1px dashed; BORDER-LEFT: #d0e0ff 1px dashed; BORDER-RIGHT: #d0e0ff 1px dashed; BORDER-TOP: #d0e0ff 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px
}
.tableDataOver {
BACKGROUND: #d0e0ff; BORDER-BOTTOM: #d0e0ff 1px dashed; BORDER-LEFT: #d0e0ff 1px dashed; BORDER-RIGHT: #d0e0ff 1px dashed; BORDER-TOP: #d0e0ff 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px
}
.controlPanel {
BACKGROUND: silver; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px
}
.controlPanelMouseOver {
BACKGROUND: #d0e0ff; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px
}
.delMouseOver {
BACKGROUND: #d0e0ff; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px
}
.scheduleButtonVisible {
BACKGROUND: silver; BORDER-BOTTOM: gray 1px dashed; BORDER-LEFT: white 1px dashed; BORDER-RIGHT: gray 1px dashed; BORDER-TOP: white 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: webdings; FONT-SIZE: 12px
}
</STYLE>
<SCRIPT language=javascript>
var modified=0
var currentLine=-1
var line=-1
function lightOn(ln)
{
if (ln==null)
  ln=parseInt(event.srcElement.ln,10)
for (i=1;i<PLList.rows.length;i++)
  if (tdt[i].ln==ln)
   line=i
cln=currentLine
oldLine=-1
for (i=1;i<PLList.rows.length;i++)
  if (tdt[i].ln==cln)
   oldLine=i
if (line==oldLine)
  return
//if td <0 then only clear all title
if (line>0)
{
  document.all.tdt[line].className="tableDataHit";
  document.ecform("medication")[line].className="tableDataHit";
  if (oldLine>0)
  {
   document.all.tdt[oldLine].className="tableData";
   document.ecform("medication")[oldLine].className="tableData";
  }
  currentLine=ln
}
}function mouseOver()
{
event.srcElement.className="delMouseOver"
}
function mouseOut()
{
event.srcElement.className="scheduleButtonVisible"
}
</SCRIPT>
</HEAD>
<BODY bgColor=white>
<FORM method=post name=ecform>
  <META content="MSHTML 5.00.2920.0" name=GENERATOR>
  <DIV id=div1 
style="LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; WIDTH: 658px"> 
    <TABLE bgColor=silver border=2 borderColorDark=gray borderColorLight=silver 
cellPadding=2 cellSpacing=1 cols=1 id=PLList rules=rows width="100%">
      <TBODY> 
      <TR bgColor=#0a6846 id=tdt> 
        <TH width=80><FONT color=white>删除 
          <INPUT name=PLID type=hidden>
          <INPUT 
      name=edit type=hidden>
          </FONT></TH>
        <TH width="559"> 
          <INPUT name=medication type=hidden>
          <FONT 
      color=white>变化表格 </font> 
      </TR>
      <TR bgColor=#e0e0e0 class=tableData id=tdt onclick=lightOn() ln="1"> 
        <TD class=scheduleButtonVisible onclick=delIt() onmouseout=mouseOut() 
    onmouseover=mouseOver() ln="1" width="80"><FONT size=2> 
          <INPUT name=PLID type=hidden 
      value=54 ln="1">
          <INPUT name=edit type=hidden value=0>
          </FONT></TD>
        <TD ln="1" width="559"> 
          <INPUT class=tableData maxLength=100 name=medication 
      onkeyup=modifiedIt(this) size=58 value="like it?" ln="1">
        </TD>
      </TR>
      <TR bgColor=#e0e0e0 class=tableData id=tdt onclick=lightOn() ln="2"> 
        <TD class=scheduleButtonVisible onclick=delIt() onmouseout=mouseOut() 
    onmouseover=mouseOver() ln="2" width="80"><FONT size=2> 
          <INPUT name=PLID type=hidden 
      value=55 ln="2">
          <INPUT name=edit type=hidden value=0>
          </FONT></TD>
        <TD ln="2" width="559"> 
          <INPUT class=tableData maxLength=100 name=medication 
      onkeyup=modifiedIt(this) size=58 value="how about it?" ln="2">
        </TD>
      </TR>
      <TR bgColor=#e0e0e0 class=tableData id=tdt onclick=lightOn() ln="3"> 
        <TD class=scheduleButtonVisible onclick=delIt() onmouseout=mouseOut() 
    onmouseover=mouseOver() ln="3" width="80"><FONT size=2> 
          <INPUT name=PLID type=hidden 
      value=56 ln="3">
          <INPUT name=edit type=hidden value=0>
          </FONT></TD>
        <TD ln="3" width="559"> 
          <INPUT class=tableData maxLength=100 name=medication 
      onkeyup=modifiedIt(this) size=58 ln="3">
        </TD>
      </TR>
      </TBODY> 
    </TABLE>
    <SCRIPT>
allCount=4
</SCRIPT>
    

    <TABLE align=center border=1 borderColorDark=white borderColorLight=gray 
cellPadding=1 cellSpacing=1 class=controlPanel cols=4 rules=all width="100%" 
nowrap>
      <TBODY> 
      <TR> 
        <TD align=middle class=controlPanel onclick=newHospitalVisit() 
    onmouseout="this.className='controlPanel'" 
    onmouseover="this.className='controlPanelMouseOver'"><FONT size=2>Add a New 
          Record, click here</FONT></TD>
      </TR>
      <TR> 
        <TD align=middle class=controlPanel onclick=move(-1) 
    onmouseout="this.className='controlPanel'" 
    onmouseover="this.className='controlPanelMouseOver'"><FONT size=2>Moveup current  
          Record, click here</FONT></TD>
      </TR>
      <TR> 
        <TD align=middle class=controlPanel onclick=move(1) 
    onmouseout="this.className='controlPanel'" 
    onmouseover="this.className='controlPanelMouseOver'"><FONT size=2>Movedown current 
          Record, click here</FONT></TD>
      </TR>
      </TBODY> 
    </TABLE>
  </DIV>
</FORM>
</BODY>
</HTML>

解决方案 »

  1.   

    简化一点点
    ------------
    <STYLE type=text/css>BODY {
    BACKGROUND: white; COLOR: black; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px
    }
    .controlPanel {
    BACKGROUND: silver; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px
    }
    .controlPanelMouseOver {
    BACKGROUND: #d0e0ff; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px
    }
    </STYLE>
    <SCRIPT language=javascript>
    function mouseOver()
    {
    event.srcElement.className="delMouseOver"
    }
    function mouseOut()
    {
    event.srcElement.className="scheduleButtonVisible"
    }
    </SCRIPT>
    </HEAD>
    <TABLE align=center border=1 borderColorDark=white borderColorLight=gray 
    cellPadding=1 cellSpacing=1 class=controlPanel cols=4 rules=all width="100%" 
    nowrap>
      <TBODY> 
      <TR> 
        <TD align=middle class=controlPanel onclick=alert("鼠标移动到上面,换成了另一种CSS")
        onmouseout="this.className='controlPanel'" 
        onmouseover="this.className='controlPanelMouseOver'"><FONT size=2>提昂地方空军司令地方军</FONT></TD>
      </TR>
      <TR> 
        <TD align=middle class=controlPanel onclick=alert("鼠标移动到上面,换成了另一种CSS")
        onmouseout="this.className='controlPanel'" 
        onmouseover="this.className='controlPanelMouseOver'"><FONT size=2>斯多夫斯多夫斯蒂芬</FONT></TD>
      </TR>
      <TR> 
        <TD align=middle class=controlPanel onclick=alert("鼠标移动到上面,换成了另一种CSS")
        onmouseout="this.className='controlPanel'" 
        onmouseover="this.className='controlPanelMouseOver'"><FONT size=2>哦扩建立</FONT></TD>
      </TR>
      </TBODY> 
    </TABLE>
      

  2.   

    用parent.FRAME.ELEMENT.style.ATTRIB=ATTRIBVAL来改变其中:
    FRAME 是要被改变样式的框架名称
    ELEMENT 是要被改变的元素的ID
    ATTRIB  是要改变的属性
    ATTRIBVAL 是属性值举个例:
    主框架页:
    <html><frameset cols="*,*">
      <frame name="left" src="left..htm">
      <frame name="right" src="right.htm">
      <noframes>
      <body>  <p>此网页使用了框架,但您的浏览器不支持框架。</p>  </body>
      </noframes>
    </frameset></html>左框架left.htm
    <html>
    <body>
    请输入字号<input size=6 name=font>
    <input type=button value="改变" onclick="parent.right.xyz.style.fontSize=font.value"> 
    </body></html>右框架right.htm
    <html><body id=xyz>看见字号改变了吗?</body></html>
      

  3.   

    错误是难免的,因为只是节选嘛,完整版本请看:
    http://www.csdn.net/Expert/TopicView1.asp?id=637044
      

  4.   

    <frameset name=framesetname cols="300,*">
    <frame name="left" src="frmleft.htm">
    <frame name="right" src="frmright.htm">
    </frameset>frmleft.htm
    <form name=form1>
    <input type=button onclick=changestyle()>
    </form>
    <script>
    function changestyle()
    {
    var n=parent.right.document.form1.tags("input").length;
    var str="";
    for(i=0;i<n;i++)
      if(parent.right.document.form1.tags("input")[i].className=="text1")
      parent.right.document.form1.tags("input")[i].className="text2";
    }
    </script>frmright.htm
    <style>
    input.text1{background:green}
    input.text2{background:red}
    </style>
    <form name=form1>
    <input type=text class=text1 name=text1>
    <input type=text class=text1 name=text2>
    <input type=text class=text1 name=text3>
    <input type=text name=text4>
    </form>
      

  5.   

    <HTML>
    <HEAD>
    <link rel="stylesheet" href="cssbottlegreen.css" />
    </head>
    <body>
    <input onclick="document.styleSheets[0].href='http://colorweb.go.163.com/cssforv6/main.css'" type="button" value="单击改变样式">
      

  6.   

    好像只有孟子的方法可以试试,前面的方法都要在改变style的地方定义id的
    我有50个地方用了相同的style 总不见的让我定义50个名字,然后在别的地方调用吧
      

  7.   

    frmleft.htm
    <form name=form1>
    <input type=button value=changetextstyle onclick=changetextstyle()>
    <input type=button value=changethstyle onclick=changethstyle()>
    </form>
    <script>
    function changetextstyle()
    {
    //适用于需要预定义className情况
    var n=parent.right.document.form1.tags("input").length;
    var str="";
    for(i=0;i<n;i++)
      if(parent.right.document.form1.tags("input")[i].className=="text1")
      parent.right.document.form1.tags("input")[i].className="text2";
    }
    function changethstyle()
    {
    //适用于不需要预定义className情况
    var n=parent.right.document.all.tags("th").length;
    var str="";
    for(i=0;i<n;i++)
      parent.right.document.all.tags("th")[i].className="th2";
    }
    </script>frmright.htm
    <style>
    input.text1{background:green}
    input.text2{background:red}
    th{background:green}
    th.th2{background:red}
    </style>
    <form name=form1>
    <input type=text class=text1 name=text1>
    <input type=text class=text1 name=text2>
    <input type=text class=text1 name=text3>
    <input type=text name=text4>
    <table><tr><th>1</th><th>2</th><th>3</th></tr><tr><td>kk</td><td>kk</td><td>kk</td></tr></table>
    </form>