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

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

      <tfoot id='VI43E'></tfoot>

    1. <legend id='VI43E'><style id='VI43E'><dir id='VI43E'><q id='VI43E'></q></dir></style></legend>
      1. 如何在选择时使 HTML 单选按钮变为粗体?

        How do you make an HTML Radio button bold on select?(如何在选择时使 HTML 单选按钮变为粗体?)

          <legend id='2SJ7r'><style id='2SJ7r'><dir id='2SJ7r'><q id='2SJ7r'></q></dir></style></legend>

            <bdo id='2SJ7r'></bdo><ul id='2SJ7r'></ul>
                  <tbody id='2SJ7r'></tbody>

                <small id='2SJ7r'></small><noframes id='2SJ7r'>

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

                  本文介绍了如何在选择时使 HTML 单选按钮变为粗体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 HTML 中,我有以下单选按钮选项

                  In HTML, I have the following radio button choices

                  o 选择 1
                  o 选择 2
                  o 选择 3

                  o Choice 1
                  o Choice 2
                  o Choice 3

                  我想要做的是,当有人从上方选择一个单选按钮时,与所选单选按钮对应的文本变为粗体.

                  What I would like to do is when someone SELECTs a radio button from above, that the text corresponding to that radio button selected becomes bold.

                  因此,例如 - 如果该人选择选择 2",则单选按钮选择现在看起来像:

                  So, for example - if the person selects "Choice 2", the radio button selection would now look like:

                  o 选择 1
                  o 选择 2
                  o 选择 3

                  o Choice 1
                  o Choice 2
                  o Choice 3

                  我该怎么做?我假设必须使用 JavaScript 或 CSS.

                  How do I do this? I assume either JavaScript or CSS has to be used.

                  提前致谢

                  更新:如果不使用 jQuery,你将如何实现nickf"解决方案?

                  推荐答案

                  你可以纯粹用 CSS 来做到这一点,但你需要将每个输入的文本包装在 span 或其他标签中:

                  You can do this purely with CSS, but you need to wrap the text of each input in a span or other tag:

                  <input type="radio" name="group1" value="Milk"><span>Milk</span><br>
                  

                  然后只使用兄弟选择器:

                  Then just use the sibling selector:

                  input[type="radio"]:checked+span { font-weight: bold; }
                  

                  这篇关于如何在选择时使 HTML 单选按钮变为粗体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  keeping radio buttons checked after form submit(表单提交后保持选中单选按钮)
                  Styling radio button - not work in IE and Firefox(样式单选按钮 - 在 IE 和 Firefox 中不起作用)
                  Bootstrap radio button quot;checkedquot; flag(Bootstrap 单选按钮“已选中旗帜)
                  Toggle HTML radio button by clicking its label(通过单击标签来切换 HTML 单选按钮)
                  Javascript how to change radio button label text?(Javascript如何更改单选按钮标签文本?)
                  How can I automatically select specific radio buttons with Greasemonkey?(如何使用 Greasemonkey 自动选择特定的单选按钮?)

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

                      <tfoot id='viwCE'></tfoot>
                    1. <small id='viwCE'></small><noframes id='viwCE'>

                          <tbody id='viwCE'></tbody>