标签:alert hive ret chart log innerhtml uml else cat
table 数值获取:
1.http://www.w3school.com.cn/jsref/dom_obj_all.asp
2.http://blog.csdn.net/xs_zgsc/article/details/8444695#
3.http://www.jb51.net/article/49780.htm
4.http://www.iteye.com/problems/81941
5.http://www.cnblogs.com/umlzhang/archive/2011/10/18/2216189.html
6.http://www.cnblogs.com/umlzhang/category/467501.html
<!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> <title></title> <script type="text/javascript"> function getTableColumnValue(tableId, rowNumber, columnNumber) { var tableRef = document.getElementById(tableId); var elementRef = tableRef.rows[rowNumber].cells[columnNumber]; var elementValue = ‘‘; if (elementRef.textContent) { // Firefox elementValue = elementRef.textContent; } else if (elementRef.innerText) { // IE elementValue = elementRef.innerText; } else { // Default elementValue = elementRef.innerHTML; var regExp = /<\/?[^>]+>/gi; elementValue = elementValue.replace(regExp, ‘‘); } //alert(elementValue); return elementValue; } </script> </head> <body> <table border="1" id="myTable"> <tr> <td>aa</td> <td>bb</td> <td>cc</td> </tr> <tr> <td>dd</td> <td>ee</td> <td>ff</td> </tr> <tr> <td>gg</td> <td>hh</td> <td>ii</td> </tr> </table> <input type="button" value="click" onclick="this.value=getTableColumnValue(‘mytable‘,1, 2);"> </body> </html>
标签:alert hive ret chart log innerhtml uml else cat
原文地址:http://www.cnblogs.com/liuyang92/p/6067891.html