「jQuery入門」配列の要素を取得するサンプル

2020年6月27日

サンプルコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
var cityArr = [ "tokyo", "oosaka", "fukuoka","yokohama" ];
$.each(cityArr, function(i, value) {
console.log(i + ': ' + value);
});
var cityArr = [ "tokyo", "oosaka", "fukuoka","yokohama" ]; $.each(cityArr, function(i, value) { console.log(i + ': ' + value); });
var cityArr = [ "tokyo", "oosaka", "fukuoka","yokohama" ];
$.each(cityArr, function(i, value) {
    console.log(i + ': ' + value);
});

説明
第1引数 インデックス
第2引数 値

IT

Posted by arkgame