<!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" type="text/javascript" src="file:///C:\Documents and Settings\Administrator\桌面\jquery-1.3.2.js">
</script >
<script type="text/javascript" language=javascript>
document.write("<b> 测试</b>");
document.write("<p>"+$("table").attri("id")+"</p>");
$(function(){
alert(this);});</script></head><body>
<table id=ff style=" background-color:#009999 "width="200" border="2">
<tr>
<th scope="col"> </th>
<th scope="col"> </th>
<th scope="col"> </th>
</tr>
<tr>
<td> </td>
<td>dsd</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
随后我尝试使用get()方法,用dom原生方法getAttribute(),也照样显示不出来ID来..真的不知道是为什么,其他属性都可以输出,就是id
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript" src="file:///C:\Documents and Settings\Administrator\桌面\jquery-1.3.2.js">
</script >
<script type="text/javascript" language=javascript>
document.write("<b> 测试</b>");
document.write("<p>"+$("table").attri("id")+"</p>");
$(function(){
alert(this);});</script></head><body>
<table id=ff style=" background-color:#009999 "width="200" border="2">
<tr>
<th scope="col"> </th>
<th scope="col"> </th>
<th scope="col"> </th>
</tr>
<tr>
<td> </td>
<td>dsd</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
随后我尝试使用get()方法,用dom原生方法getAttribute(),也照样显示不出来ID来..真的不知道是为什么,其他属性都可以输出,就是id
解决方案 »
- Javascript里apply的疑问
- javascript 关于触发事件的简单问题 望高手帮忙
- 想做一个特殊下拉列表,请大家帮忙!
- 链接控制表格的缓慢出现和消失,请帮忙修改下代码!
- 将字符串转换为日期时间格式
- 请高手指点,javascript如何控制鼠标的位置?
- 如何在那CheckBox在选中或去掉选中的时候显示积分到HTML页面上呢?
- 用xmlhttp将html的数据打包成multipart/form-data格式,实现异步上传文件功能
- google浏览器,禁用后退按钮怎么做???
- 求Tab面板,马上接贴,顶者有分~!
- 媲美flash动画效果的导航条
- 按button1刷新,怎么能在页面table上还显示数据
($(table).attr("id");
})这不就获取到id了吗
把<script>....</script>放到</html>之后就可以了。另:$("table").attri("id"),你拼写错了