1.页面加载就调用的函数
window.onload = function(){
//这里的代码将在页面准备就绪之后开始执行
} 此为js写法等价于下面jquery写法
$(window).load(function() {
$("#btn-upload").click(function(){ //比如说:
uploadPhotos();
});
});
$(document).ready(function(){
...
});
http://zhidao.baidu.com/link?url=KMij-4ZDhso9k9biXO_ZkARxMO-NnMXFRttnRtEiVevKv5nnZ_iKYc7p1SmcSEQKGbl0LmpA4nWClAGVlVSp76uAUB7yBuhuFbo4ZIkFo3m
http://blog.csdn.net/jallin2001/article/details/6600311
http://zhidao.baidu.com/link?url=U4cwZwq3jE03gr9QqyVWNQ7K5v9sG2JtYRqy-yMglokkOsQHqMaMLFxDVL87gG5fk86sUR9RU86S0bDTBD2tka
2.jQuery遍历元素
$("#toDelete").children().each(function(){
$("#addMenu").find("input[id="+$(this).attr("id")+"]").attr("disabled",true);
});
3.一堆input点击触发相应事件
$("#toDelete").on("click","input",function(){
$(this).remove();
$("#addMenu").find("input[id="+$(this).attr("id")+"]").attr("disabled",false);
});
http://www.runoob.com/jquery/event-on.html