我是Jquery編碼的學習者,我的任務是顯示/隱藏表點擊元素SPAN元素。我試圖與不工作下面提到的jQuery代碼..在jQuery中顯示隱藏元素表元素
HTML代碼:
foreach($array as $key => $arrValue) {
<span id="link<?=$count?>">$key</span>
<table id="tbl<?=$count?>">
foreach($arrValueas $key => $value) {
<tr><td>$value</td></tr>
}
</table>
}
我jQuery代碼是:
$(function(){
// To open/close field's group div
$("span").each(function (i){
i++;
$('#link' + i).click(function (i) {
$('#tbl' + i).toggle(800);
});
});
});
請避免PHP打開關閉在HTML代碼中標記問題..
而你的問題是...?請爲我們提供生成的html。 – Johan