我有一个简单的脚本:
$('.expand').each(function(i){
var _Expand = $(this).parent();
ExpGroupBy(_Expand);
});
Run Code Online (Sandbox Code Playgroud)
尝试通过类'expand' 传递<tr>所有内容<td>
然而,firebug不断弹出错误:
'TypeError:formObj.getElementsByTagName不是函数'
有任何想法吗?
谢谢^^
只要函数理解参数是jQuery对象而不是DOM元素本身.如果函数需要一个DOM元素引用,你可以像这样轻松地做到这一点......
$('.expand').each(function(i){
var _Expand = $(this).parent();
ExpGroupBy(_Expand[0]); // Note the [0]
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5679 次 |
| 最近记录: |