企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
[TOC] ## .each() 语法: ``` jQuery.each( collection, callback(indexInArray, valueOfElement) ) ``` ### 遍历数组 ``` $.each([52, 97], function(index, value) { alert(index + ': ' + value); }); ``` ### 遍历对象 ``` var obj = { "flammable": "inflammable", "duh": "no duh" }; $.each( obj, function( key, value ) { alert( key + ": " + value ); }); ```