• <bdo id='pCeV0'></bdo><ul id='pCeV0'></ul>

      1. <tfoot id='pCeV0'></tfoot>
      2. <small id='pCeV0'></small><noframes id='pCeV0'>

        <i id='pCeV0'><tr id='pCeV0'><dt id='pCeV0'><q id='pCeV0'><span id='pCeV0'><b id='pCeV0'><form id='pCeV0'><ins id='pCeV0'></ins><ul id='pCeV0'></ul><sub id='pCeV0'></sub></form><legend id='pCeV0'></legend><bdo id='pCeV0'><pre id='pCeV0'><center id='pCeV0'></center></pre></bdo></b><th id='pCeV0'></th></span></q></dt></tr></i><div id='pCeV0'><tfoot id='pCeV0'></tfoot><dl id='pCeV0'><fieldset id='pCeV0'></fieldset></dl></div>
        <legend id='pCeV0'><style id='pCeV0'><dir id='pCeV0'><q id='pCeV0'></q></dir></style></legend>

        HTML中id和name属性的区别

        时间:2023-09-08
      3. <tfoot id='1FV1M'></tfoot>

        <small id='1FV1M'></small><noframes id='1FV1M'>

      4. <i id='1FV1M'><tr id='1FV1M'><dt id='1FV1M'><q id='1FV1M'><span id='1FV1M'><b id='1FV1M'><form id='1FV1M'><ins id='1FV1M'></ins><ul id='1FV1M'></ul><sub id='1FV1M'></sub></form><legend id='1FV1M'></legend><bdo id='1FV1M'><pre id='1FV1M'><center id='1FV1M'></center></pre></bdo></b><th id='1FV1M'></th></span></q></dt></tr></i><div id='1FV1M'><tfoot id='1FV1M'></tfoot><dl id='1FV1M'><fieldset id='1FV1M'></fieldset></dl></div>

          <legend id='1FV1M'><style id='1FV1M'><dir id='1FV1M'><q id='1FV1M'></q></dir></style></legend>
                <bdo id='1FV1M'></bdo><ul id='1FV1M'></ul>
                  <tbody id='1FV1M'></tbody>
                  本文介绍了HTML中id和name属性的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  idname 属性有什么区别?它们似乎都具有提供标识符的相同目的.

                  What is the difference between the id and name attributes? They both seem to serve the same purpose of providing an identifier.

                  我想知道(特别是关于 HTML 表单)是否有必要或出于任何原因鼓励使用两者.

                  I would like to know (specifically with regards to HTML forms) whether or not using both is necessary or encouraged for any reasons.

                  推荐答案

                  name 属性在表单提交中发送数据时使用.不同的控件响应不同.例如,您可能有几个具有不同 id 属性但 name 相同的单选按钮.提交后,响应中只有一个值 - 您选择的单选按钮.

                  The name attribute is used when sending data in a form submission. Different controls respond differently. For example, you may have several radio buttons with different id attributes, but the same name. When submitted, there is just the one value in the response - the radio button you selected.

                  当然,它的意义远不止这些,但它肯定会让你朝着正确的方向思考.

                  Of course, there's more to it than that, but it will definitely get you thinking in the right direction.

                  这篇关于HTML中id和name属性的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Javascript/jQuery 从 HTML 元素中获取所有属性 下一篇:何时在 JavaScript 中使用 setAttribute 与 .attribute=?

                  相关文章

                  最新文章

                    <small id='co7wR'></small><noframes id='co7wR'>

                    • <bdo id='co7wR'></bdo><ul id='co7wR'></ul>

                  1. <tfoot id='co7wR'></tfoot>

                    <i id='co7wR'><tr id='co7wR'><dt id='co7wR'><q id='co7wR'><span id='co7wR'><b id='co7wR'><form id='co7wR'><ins id='co7wR'></ins><ul id='co7wR'></ul><sub id='co7wR'></sub></form><legend id='co7wR'></legend><bdo id='co7wR'><pre id='co7wR'><center id='co7wR'></center></pre></bdo></b><th id='co7wR'></th></span></q></dt></tr></i><div id='co7wR'><tfoot id='co7wR'></tfoot><dl id='co7wR'><fieldset id='co7wR'></fieldset></dl></div>
                    1. <legend id='co7wR'><style id='co7wR'><dir id='co7wR'><q id='co7wR'></q></dir></style></legend>