嗨即時嘗試替換鏈接,如果我點擊這個其他鏈接。但我不能得到點擊工作,當我添加jQuery的鏈接replace()
或html();
。我即將做錯了什麼?點擊將不會工作時放置與jQuery的.html()或.replace()
這是我嘗試在代碼中使用
$(document).ready(function() {
var countTotal = $('#myTable tr').length;
$("#hideTotalCount").val(countTotal);
$('#clickMeAll').click(function() {
var totalCount = $("#hideTotalCount").val() - 1;
$('#myTable').paginateTable({ rowsPerPage: totalCount, pager: '.pageNumbersOnly', maxPageNumbers: 4 });
$('#placeLink').replaceWith("<a href='#' id='clickMeRegular'>Back to regular</a>");
});
$('#clickMeRegular').click(function() {
var totalCount = $("#original").val();
$('#myTable').paginateTable({ rowsPerPage: totalCount, pager: '.pageNumbersOnly', maxPageNumbers: 4 });
$('#placeLink').replaceWith("<a href='#' id='clickMeAll'>ViewAll</a>");
});
$('#myTable').paginateTable({ rowsPerPage: 5, pager: '.pageNumbersOnly', maxPageNumbers: 4 });
$('#placeLink').html("<a href='#' id='clickMeAll'>ViewAll</a>");
});
和#placeLink
只是一個普通的<span>
也許有人知道的東西,可以把我在正確的方向?謝謝
我會做隱藏的。謝謝 –