爲什麼不能工作?jQuery - 切換.html文本?
HTML
<a href="#" id="showMore">Before</a>
JS
$('#showMore').click(function() {
$(this).toggle(
function() {
$(this).html('<a href="#">After</a>');},
function() {
$(this).html('<a href="#">Before</a>');
});
});
「這種方法的簽名是用jQuery的1.8棄用,在jQuery的1.9去除。」 https://api.jquery.com/toggle-event/ 它現在所做的只是將點擊的對象設置爲視線外的動畫。 – gl03 2015-11-01 21:30:07
它不適用於我 – 2016-09-25 04:11:26
不工作,絕對不工作 – 2017-06-23 06:24:07