aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/mozilla/tech/xul/attribute/menuitem.name/index.html
blob: a485138846b41d6dd0fc1fca02229a9d69b7788f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: menuitem.name
slug: Mozilla/Tech/XUL/Attribute/menuitem.name
tags:
  - XUL Attributes
translation_of: Archive/Mozilla/XUL/Attribute/menuitem.name
---
<div class="noinclude">
 <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
<dl>
 <dt>
  <code id="a-menuitem.name"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menuitem.name">name</a></code></dt>
 <dd>
  Type:
  <i>
   string name</i>
 </dd>
 <dd>
  Radio <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>s with the same name as put into a group. Only one <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> in each radio group can be checked at a time.</dd>
</dl>
<div class="noinclude">
 <h3 id="Example" name="Example">Example</h3>
 <pre>&lt;toolbox&gt;
  &lt;menubar id="planets-menubar"&gt;
    &lt;menu id="planet-menu" label="Planet"&gt;
      &lt;menupopup&gt;
        &lt;menuitem id="jupiter" label="Jupiter" type="radio" name="planet"/&gt;
        &lt;menuitem id="saturn" label="Saturn" type="radio" name="planet" checked="true"/&gt;
        &lt;menuitem id="uranus" label="Uranus" type="radio" name="planet"/&gt;
      &lt;/menupopup&gt;
    &lt;/menu&gt;
  &lt;/menubar&gt;
&lt;/toolbox&gt;
</pre>
 <h3 id="See_also" name="See_also">See also</h3>
 <p><a href="cn/XUL/Attribute/name">name</a> and <a href="cn/XUL_Tutorial/More_Menu_Features#Adding_Checkmarks_to_Menus">menus in the XUL Tutorial</a></p>
</div>
<p></p>