项目中使用了LIST动态生成了多行.当点击对应行的button时调用函数并传入this
结构如下
函数写法
function index(btn){
var idx = $(btn).parent().parent().index();
alert("当前行"+idx);
}
项目中使用了LIST动态生成了多行.当点击对应行的button时调用函数并传入this
结构如下
函数写法
function index(btn){
var idx = $(btn).parent().parent().index();
alert("当前行"+idx);
}
转载于:https://my.oschina.net/MrBamboo/blog/742147