【发布时间】:2016-06-10 15:09:41
【问题描述】:
toggle() 方法在 jQuery 1.8 版中已弃用,并在 1.9 版中被删除。 Documentation
如何在 jQuery 1.11+ 中使用类似 toggle() 的函数?
Fiddle中的完整代码
<script>
function test(){
$("*:contains(ไทย):last").text("English");
}
function test2(){
$("*:contains(English):last").text("ไทย");
}
$("#click").toggle(
test(),
test2();
});
</script>
【问题讨论】:
-
看看这个toggleClick
-
yurzui 它的工作。非常感谢。
标签: javascript jquery function toggle