<legend id='Zqo99'><style id='Zqo99'><dir id='Zqo99'><q id='Zqo99'></q></dir></style></legend>

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

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

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

          <bdo id='Zqo99'></bdo><ul id='Zqo99'></ul>

        通过 JavaScript 检查单选按钮组的值?

        Checking Value of Radio Button Group via JavaScript?(通过 JavaScript 检查单选按钮组的值?)
      2. <small id='M38wG'></small><noframes id='M38wG'>

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

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

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

                  <legend id='M38wG'><style id='M38wG'><dir id='M38wG'><q id='M38wG'></q></dir></style></legend>
                    <tbody id='M38wG'></tbody>
                  本文介绍了通过 JavaScript 检查单选按钮组的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这可能看起来很愚蠢而且非常愚蠢,但我似乎无法弄清楚如何通过 JavaScript 在我的 HTML 表单中检查单选按钮组的值.我有以下代码:

                  This may seem silly and downright stupid but I can't seem to figure out how to check the value of a radio button group in my HTML form via JavaScript. I have the following code:

                  <input type="radio" id="genderm" name="gender" value="male" />
                  <label for="genderm">Male</label>
                  <input type="radio" id="genderf" name="gender" value="female" />
                  <label for="genderf">Female</label>
                  

                  如何通过 JavaScript 检索 gender 的值?

                  How do I retrieve the value of gender via JavaScript?

                  推荐答案

                  如果你使用 jQuery 之类的 javascript 库,这很容易:

                  alert($('input[name=gender]:checked').val());
                  

                  此代码将选择带有 gender 名称的 checked 输入,并获取它的 value.是不是很简单?

                  This code will select the checked input with gender name, and gets it's value. Simple isn't it?

                  现场演示

                  这篇关于通过 JavaScript 检查单选按钮组的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)

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

                        • <bdo id='6BPDr'></bdo><ul id='6BPDr'></ul>
                          <tfoot id='6BPDr'></tfoot>

                              <tbody id='6BPDr'></tbody>
                          • <small id='6BPDr'></small><noframes id='6BPDr'>