HTML函數內部函數如何工作?
<p>This is a <b>bold</b> paragraph.</p>
<button>Add</button>
jQuery的
$("button").click(function(){
$("p").text(function(i,origText){
return "Old text: " + origText + " New text: Hello world! (index: " + i + ")";
});
});
我想知道origText不叫外面的功能,但它返回的值。怎麼樣?
潛入jQuery的源代碼! – 2013-07-17 11:58:42