易截截图软件、单文件、免安装、纯绿色、仅160KB

jsp页面的点击触发问题

在jsp页面中有2块用table圈起来的空白区域A和B,我想用鼠标点击空白区域A的时候让空白区域A的背景颜色变成蓝色,再点击一下则又变回原先的背景颜色,空白区域B的操作效果也是如此,该怎么办呢?
注:A,B是空白区域,在页面上看不到按钮一类的东西的
<table id=table border='1'>
  <tr height='30'>
    <td style='width:200' id='table1' onclick='change_bgcolor(table2)'> </td>
    <td style='width:200' id='table2' onclick='change_bgcolor(table1)'> </td>
  </tr>
</table>
<script>
    function 'change_bgcolor(id){
        var obj = document.getElementById(id);
        if(obj.style.backgroundcolor=='red'){
          obj.style.backgroundcolor=='green' ;
        }else{
          obj.style.backgroundcolor=='red';
        }
    }
</script>

没有测试,大致是这样的

中Table中加个"&nbsp;"试试看


<head>
</head>
<body>
<table id=table border='1'>
  <tr height='30'>
    <td style='width:200;back


相关问答:

jsp链接sql2000的疑问?



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

关于在JSP中上传图片的相关问题 - Web 开发 / 其他

//用客户的session的id建立一个临时文件:
//String tempFileName=(String)session.getId();
String tempFileName = (String)session.getId();
//out.println(& ......

jsp相关问题 - Web 开发 / JavaScript

我想登录后,如果登录成功就去执行某个页面
我现在的代码是这样的:
if(rs.next()){
 session.setAttribute( "username" , user);
  <jsp:include page="login.jsp" />// ......

JSP 接收 FORM 提交 - Java / Web 开发

一个JSP页面接收其他页面提交过来的FORM表单,但是要求只接收当前站点及其子站点提交过来的FORM表单,其他站点提交过来的表单不接收,这个怎么设置?
用过滤器
filter
将当前站点及其子站点放一个目录 
然 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号