getElementsByTagName("td") 抓不到標籤裏面的標籤 <img id="img1" src="http://l.yimg.com/tw.yimg.com/a/tw/cathy/080620_09.jpg" hspace="20">document.getElementById("img1").src="新的URL"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta http-equiv="Content-Language" content="zh-tw"><meta http-equiv="Content-Type" content="text/html; charset=big5"><title>新增網頁2</title></head><body><div align="center"><table border="1" width="100%" id="table3"> <tr> <td>討論區</td> </tr></table><table border="1" width="100%" id="table1"><tr> <td width="195">日期:2008/06/20 19:13</td> <td> </td> </tr> <tr> <td width="195">名稱:</td> <td>xxxx</td> </tr> <tr><td width="195"><img src="http://l.yimg.com/tw.yimg.com/a/tw/cathy/080620_09.jpg" hspace="20"></td> <td> </td> </tr></table><SCRIPT LANGUAGE="JavaScript">alert(document.getElementById("table1").childNodes[0].childNodes[2].childNodes[0].childNodes[0].src)</SCRIPT><table border="1" width="100%" id="table2"> <tr> <td>修改</td> </tr></table></div></body></html> <html><head><meta http-equiv="Content-Language" content="zh-tw"><meta http-equiv="Content-Type" content="text/html; charset=big5"><title>新增網頁2</title></head><body><div align="center"><table border="1" width="100%" id="table3"> <tr> <td>討論區</td> </tr></table><table border="1" width="100%" id="table1"> <tr> <td width="195">日期:2008/06/20 19:13</td> <td> </td> </tr> <tr> <td width="195">名稱:</td> <td>xxxx</td> </tr> <tr> <td width="195"><img src="http://l.yimg.com/tw.yimg.com/a/tw/cathy/080620_09.jpg" hspace="20"></td> <td> </td> </tr></table><table border="1" width="100%" id="table2"> <tr> <td>修改</td> </tr></table><SCRIPT LANGUAGE="JavaScript">alert(document.getElementById("table1").rows(2).childNodes[0].firstChild.src);</SCRIPT></div></body></html> s_liangchao1s不好意思囉mingxuan3000比較早發兩位大大的方法都能抓到寫法有些微不同都很有學習價值在此多謝了 请教,用什么方式控制新窗口一直在当前显示呢? JS跨域COOKIE怎么弄啊? 关于Microsoft Script Editor下面如何格式化代码的问题 字符替换问题 关于新建optgroup的问题,,帮帮忙 关于键盘模拟的问题 谢谢 高手帮忙看看! 菜鸟问题!在线! js疑难,答对高分相赠 ExtJS4中使用Ext.ux.comboboxtree出现图片重叠问题,请求帮助! 一个联动2级菜单的问题,帮忙下吧 如何制作鼠标移到按钮上就弹出一无边框窗口?
<html>
<head>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>新增網頁2</title>
</head>
<body>
<div align="center">
<table border="1" width="100%" id="table3">
<tr>
<td>討論區</td>
</tr>
</table>
<table border="1" width="100%" id="table1">
<tr>
<td width="195">日期:2008/06/20 19:13</td>
<td> </td>
</tr>
<tr>
<td width="195">名稱:</td>
<td>xxxx</td>
</tr>
<tr><td width="195"><img src="http://l.yimg.com/tw.yimg.com/a/tw/cathy/080620_09.jpg" hspace="20"></td>
<td> </td>
</tr>
</table>
<SCRIPT LANGUAGE="JavaScript">
alert(document.getElementById("table1").childNodes[0].childNodes[2].childNodes[0].childNodes[0].src)
</SCRIPT>
<table border="1" width="100%" id="table2">
<tr>
<td>修改</td>
</tr>
</table>
</div>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>新增網頁2</title>
</head>
<body>
<div align="center">
<table border="1" width="100%" id="table3">
<tr>
<td>討論區</td>
</tr>
</table>
<table border="1" width="100%" id="table1">
<tr>
<td width="195">日期:2008/06/20 19:13</td>
<td> </td>
</tr>
<tr>
<td width="195">名稱:</td>
<td>xxxx</td>
</tr>
<tr>
<td width="195"><img src="http://l.yimg.com/tw.yimg.com/a/tw/cathy/080620_09.jpg" hspace="20"></td>
<td> </td>
</tr>
</table>
<table border="1" width="100%" id="table2">
<tr>
<td>修改</td>
</tr>
</table>
<SCRIPT LANGUAGE="JavaScript">
alert(document.getElementById("table1").rows(2).childNodes[0].firstChild.src);
</SCRIPT></div>
</body>
</html>
mingxuan3000比較早發兩位大大的方法都能抓到
寫法有些微不同
都很有學習價值
在此多謝了