2013年3月2日土曜日

開発環境

『初めてのJavaScript 第2版』(シェリー・パワーズ著(Shelley Powers著)、武舎 広幸+武舎 るみ訳、オライリー・ジャパン、2009年、ISBN978-4-87311-425-5) の11章(ドキュメントオブジェクトモデル)練習問第11-2, 3を解いてみる。

その他参考書籍

2、3.

コード(BBEdit)

// body以下の子要素すべてのtagName, nodeTypeを調べてみる
var result = "",
    children = $('body').children(),
    i, max;
for ( i = 0, max = children.length; i < max; i += 1 ) {
    result += children[i] + ": " + children[i].tagName + ", " +
        children[i].nodeType + "\n";
}
$('#pre0').text(result);










						

0 コメント:

コメントを投稿