<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <script language="javascript"> function cc(){ var bb=document.getElementById("abc").getElementsByTagName("td"); for(var i=0;i<bb.length;i++){ bb[i].onclick= function(){  document.form1.txt.value=this.innerText; } } } </script> </head>

<body>  点下单元格看看  <table width="600" border="1" cellspacing="0" cellpadding="0" id="abc">   <tr>     <td height="20" align="center">11</td>     <td align="center">22</td>     <td align="center">33</td>   </tr>   <tr>     <td height="20" align="center">wer</td>     <td align="center">werf</td>     <td align="center">sdf</td>   </tr>   <tr>     <td height="20" align="center">sdf</td>     <td align="center">wer</td>     <td align="center">ewr</td>   </tr>   <tr>     <td height="20" align="center">sdf</td>     <td align="center">sdf</td>     <td align="center">sdf</td>   </tr> </table> <p> </p> <form id="form1" name="form1" method="post" action="">   <input type="text" name="txt" id="txt" /> </form> <p> </p> <p><br /> </p> <script language="javascript"> cc(); </script> </body> </html>

点下单元格看看

11 22 33
wer werf sdf
sdf wer ewr
sdf sdf sdf

html 如何获取表格中所选行的一行数据,并赋值到对应的TEXT里面?的更多相关文章

  1. js获取表格视图所选行号的ids

    实例化数组 遍历所选行push到数组中 将数组join转换为以,分割的字符串 /*获取指定id的datagrid的表格视图的选择的ids*/ function getDataGridSelectRow ...

  2. dojo中获取表格中某一行的某个值

    dojo中经常出现对表格中的某行进行操作,如单击某行修改.删除等.那怎样获取某行的唯一标示呢? 如查询表格中的某列有个userId,并且这个是唯一的,那么可以通过它来访问这一列 具体操作代码如下: v ...

  3. 如何获取jqGrid中选择的行的数据

    原文地址:http://hi.baidu.com/feifan3211/item/c5831f44158761a5df2a9fc1 如何获取jqGrid中选择的行的数据? 下面可以获取选择一行的id, ...

  4. 获取jqGrid中选择的行的数据以及 jqGrid获得所有行数据的方法

    获取jqGrid中选择的行的数据: 获取选择一行的id,如果你选择多行,那下面的id是最后选择的行的id:   1 var id=$('#gridTable').jqGrid('getGridPara ...

  5. Vue. 之 Element获取table中选中的行

    Vue. 之 Element获取table中选中的行 问题描述: 如下截图,在Table中选择数据后,然后在点击“统计”按钮,获取Table表中选择的行 解决方案: 1. 给“统计”这个按钮添加一个点 ...

  6. php如何实现把多平台文件中所有的行合成一行?

    php如何实现把多平台文件中所有的行合成一行? 一.总结 1.str_replace中的数组替换:str_replace(array("/r","/n",&qu ...

  7. 用JavaScript,获取Table中指定的行、列

    前言: 先要谢谢George Wing的慷慨赠书<悟透JavaScript>,让我更加感受到了技术交流的重要性,呵呵~ 进入正题,面试题中有一题:如何通过JavaScript获取Table ...

  8. C# 在Word表格中插入新行(表格含合并行)

    public string CreateWordFile(string CheckedInfo)         {             string message = "" ...

  9. 用python+openpyxl从表格中读取测试用例的多条数据,然后将执行结果写入表格中

    # -*- coding: utf-8 -*- from selenium import webdriver from openpyxl import load_workbook class mylo ...

随机推荐

  1. PHP最原始的上传文件函数

    <?php $upload_file=$_FILES['upload_file']['tmp_name']; $upload_file_name=$_FILES['upload_file'][' ...

  2. symfony中twig的模板变量与注释

    程序会传递给模板若干变量,你需要在模板里输出他们.例如输出$hello .1{{ hello }}.如果传递给模板的是对象或者数组,你可以使用点. 来输出对象的属性或者方法,或者数组的成员.或者你可以 ...

  3. [算法][包围盒]AABB简单类

    头文件: #pragma once #include <iostream> //一个假的点类型 struct Vector3 { float x; float y; float z; }; ...

  4. Pipe(点积叉积的应用POJ1039)

    Pipe Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9723   Accepted: 2964 Description ...

  5. Tiling 分类: POJ 2015-06-17 15:15 8人阅读 评论(0) 收藏

    Tiling Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8091   Accepted: 3918 Descriptio ...

  6. Unity-Animator深入系列---控制IK

    回到 Animator深入系列总目录 要让代码控制IK,需要先在Animator中打开IK pass 然后,和IK相关的代码需要放到相应的函数中去: void OnAnimatorIK() { Deb ...

  7. Unity-Animator深入系列---FAQ

    回到 Animator深入系列总目录 Q: 如果想做角色负伤的一套动画,但是又和原有状态机不冲突,只是想换动画剪辑,应该怎么办? A: 新建一个层,设置为同步模式.这时候你不能在同步层添加状态,但你可 ...

  8. C语言typeof详解 offsetof

    http://blog.chinaunix.net/uid-28458801-id-4200573.html 前言:    typeof关键字是C语言中的一个新扩展,这个特性在linux内核中应用非常 ...

  9. 某些输入文件使用或覆盖了已过时的 API

    android出现注: 某些输入文件使用或覆盖了已过时的 API. 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译. 注: 某些输入文件使用了未经检查或不安全的操作. 注 ...

  10. Solr开发文档

    转载:http://www.cnblogs.com/hoojo/archive/2011/10/21/2220431.html Solr 是一种可供企业使用的.基于 Lucene 的搜索服务器,它支持 ...