$(document).ready(function(){
$("#btn1").click(function(){
$("#test1").text(function(i,origText){
return "Old text: " + origText + " New text: Hello world! (index: " + i + ")";
});
});
$("#btn2").click(function(){
$("#test2").html(function(i,origText){
return "Old html: " + origText + " New html: Hello world! (index: " + i + ")";
});
});
});
这是粗体文本。
这是另一段粗体文本。
显示旧/新文本
显示旧/新 HTML
这个实例里面用了html text两个回调函数 想知道其意义在哪里 以及两个参数分别代指什么 多谢!