Home > All > prototype.jsで特定要素を配列で取得する

prototype.jsで特定要素を配列で取得する

//全ての画像要素
images = $$("img");
alert(images[0].src);

//id、classで絞込み
field = $$('div#loginForm .field input');
alert(field[0].value);

関連記事:

  1. No comments yet.
  1. No trackbacks yet.