This Document has Moved. この文書は http://www2u.biglobe.ne.jp/~oz-07ams/2001/object-index.html に移動しました。 Japanese fonts required. All rights reserved. 1998-2015 TAKI
下記「あいうえお」に触ると子ノードの数だけノードタイプをダイアログ表示します あいうえお <script> <!-- function getNodeType(oj) { // 子ノードの数だけ処理を繰り返す for (i=0;i<oj.childNodes.length;i++) { // ノードタイプをダイアログ表示する alert(oj.childNodes.item(i).nodeType) } } //--> </script> <p onmouseover="getNodeType(this)" ><b>あ</b>いう<i>え</i>お</p> このpタグの中には「あ」と 「いう」と「え」と「お」の4つの ノードが含まれいています。これらは順に「Elementノード」[Textノード]「Elementノード」[Textノード]なので、
TextRangeオブジェクトの位置と大きさを得られます。 rng.boundingLeft rng.boundingTop rng.boundingWidth rng.boundingHeight 例えば下のようなボタンの文字の、ドキュメントの上からの座標を得ます。 var rng = obj.createTextRange(); //objはボタン alert(rng.boundingTop); TextRange オブジェクトに対しコマンドを実行することができます。 rng.execCommand(sCommand [, bUserInterface [, vValue]]) コマンドの実行が成功すれば true、 失敗すれば false が帰ります。 sCommand がコマンドを表す文字列です。 下に例がありますが、非常に多くのコマンドがあります。詳しくは、 Command I
Update: id:reinyannyan:20060411:p1 に続きます getElementsByTagName の様なメソッドで得られた、配列ではない要素集合を配列のように扱いたい時に、prototype.js では "$A" という関数によってまず配列化する、という方法を用います。 これは非常に素晴らしい、便利な方法なんですが、集合の規模が大きくなると、それだけ配列化によるオーバーヘッドも大きなものになってしまいます。 そこで、仮にこのようなものを作ってみました。 // DOM Iterator var Domi = { each: function (collection, yield) { for (var i = 0; i < collection.length; i++) yield(collection[i]); } };べつに配列が欲しいわけじゃない、単純に ea
This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Microsoft Learn. Spark possibility. Build skills that open doors. See all you can do with documentation, hands-on training, and certifications to help you get the most from Microsoft products. Learn by doing Gain the skills you can apply to everyday situ
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. * Some parts of this feature may have varying levels of support. Learn moreSee full compatibilityReport feedback The Range interface represents a fragment of a document that can contain nodes and parts of text nodes. A range can be created by using the Document.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く