先看如下代码: (function ($) { var div = $("<div></div>").css({width: "100px", height: "100px"}); var colors = ["red", "blue", "yellow"]; for (var c = 0; c < colors.length; c++) { var per…
1.最直接的模式,直接将一个function对象传入方法函数,如下面的click(),好处坏处一看便知 $("#btnComfirmChooseCompany").click(function () { var companyName = ""; var companyID = ""; var hasChecked = false; var allCheckbox = $("input[name='companyID']");…