摘要: 1. forEach() forEach() 方法从头至尾遍历数组,为每个元素调用指定的函数。如上所述,传递的函数作为forEach()的第一个参数。然后forEach()使用三个参数调用该 函数:数组元素、元素的索引和数组本身。如果只关心数组元素的值,可以编写只有一个参数的函数——额外的参数将忽略 阅读全文
posted @ 2016-07-26 19:48 PheonixHkbxoic 阅读(88084) 评论(1) 推荐(2) 编辑
摘要: 1.attr("value")=原来的默认值 ,而val()=用户改变的值. 2.The gist is that .attr(...) is only getting the objects value at the start (when the html is created). val() 阅读全文
posted @ 2016-07-26 10:40 PheonixHkbxoic 阅读(812) 评论(0) 推荐(0) 编辑