下面是表格中一个td的代码,使用迭代,表格行数不确定
<td>
<p class="keyWord" style="display: none;"><span id="kws_<s:property value="listRe[#st.index][#s2.index].productId"/><s:property value="contentsList[#st.index].code"/>"><s:property value="listRe[#st.index][#s2.index].keyword"/></span>
<a href="#" class="gold_R">修改</a></p>
<p style="display: block;" class="KWrepair" ><input type="text" name="" id="kwText_<s:property value="listRe[#st.index][#s2.index].productId"/><s:property value="contentsList[#st.index].code"/>"/>
<a href="#" backId="<s:property value="listRe[#st.index][#s2.index].keywordRecommendId"/>" id="sub_<s:property value="contentsList[#st.index].value"/>_<s:property value="listRe[#st.index][#s2.index].classifyId"/>_<s:property value="listRe[#st.index][#s2.index].productId"/>_<s:property value="contentsList[#st.index].code"/>"
class="gold_S">确定</a></p>
</td>
我使用jquery操作显示 "修改" 还是显示 "确定"
代码如下
$(".gold_R").live("click",function(){//点击修改
$(this).parent().hide();
$(this).parent().next().show();
//$('.KWrepair').show();
})
效果如图
问题如下:我在这样使用的时候,点击修改时,表格的行全部变成了输入框展现,而修改标签隐藏,我需要的效果是点击时对应的那部分切换成修改效果(注:我在刷新表格时使用ajax刷新页面,将表格全删除,用append重写,此时的表格没有出现这种问题,那部分也是用上述jquery操作的)