aboutsummaryrefslogtreecommitdiff
path: root/files/ja/archive/mozilla/xul/method/removeitemat/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/archive/mozilla/xul/method/removeitemat/index.html')
-rw-r--r--files/ja/archive/mozilla/xul/method/removeitemat/index.html46
1 files changed, 46 insertions, 0 deletions
diff --git a/files/ja/archive/mozilla/xul/method/removeitemat/index.html b/files/ja/archive/mozilla/xul/method/removeitemat/index.html
new file mode 100644
index 0000000000..f75d24c21d
--- /dev/null
+++ b/files/ja/archive/mozilla/xul/method/removeitemat/index.html
@@ -0,0 +1,46 @@
+---
+title: removeItemAt
+slug: Archive/Mozilla/XUL/Method/removeItemAt
+tags:
+ - XUL Methods
+ - XUL Reference
+translation_of: Archive/Mozilla/XUL/Method/removeItemAt
+---
+<div class="noinclude"><span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/ja/docs/XUL_Reference" title="/ja/docs/XUL_Reference">XUL リファレンス HOME</a></span></div>
+
+<dl>
+ <dt><span id="m-removeItemAt"><code><a href="https://developer.mozilla.org/ja/docs/Mozilla/Tech/XUL/Method/removeItemAt">removeItemAt( index )</a></code></span></dt>
+ <dd>戻り値の型: <em>要素</em></dd>
+ <dd>要素内の指定した index の子項目を削除します。このメソッドは削除した項目を返します。</dd>
+</dl>
+
+<div class="noinclude">
+
+<pre class="brush:js">&lt;script type="text/javascript"&gt;
+function removeSelectedItem() {
+ var myListBox = document.getElementById('myListBox');
+
+ if(myListBox.selectedIndex == -1){
+ return; // no item selected so return
+ } else {
+ myListBox.removeItemAt(myListBox.selectedIndex);
+ }
+}
+&lt;/script&gt;
+
+&lt;button label="Remove selected item" oncommand="removeSelectedItem()" /&gt;
+
+&lt;listbox id="myListBox"&gt;
+ &lt;listitem label="Alpha" /&gt;
+ &lt;listitem label="Beta" /&gt;
+ &lt;listitem label="Oscar" /&gt;
+ &lt;listitem label="Foxtrot" /&gt;
+&lt;/listbox&gt;
+</pre>
+
+ <h2 id="See_also" name="See_also">関連情報</h2>
+ <ul>
+<li><a href="/ja/docs/XUL/Method/removeAllItems"><code>removeAllItems()</code></a> 、 <a href="/ja/docs/XUL/Method/appendItem"><code>appendItem()</code></a> 、 <a href="/ja/docs/XUL/Method/insertItemAt"><code>insertItemAt()</code></a></li>
+</ul>
+
+</div>