当前位置: 首页 > 新闻动态 > 软件编程

jQuery中:radio选择器用法实例

作者:用户投稿 浏览: 发布日期:2026-01-16
[导读]:这篇文章主要介绍了jQuery中:radio选择器用法,实例分析了:radio选择器的功能、定义及匹配单选按钮的使用技巧,需要的朋友可以参考下

本文实例讲述了jQuery中:radio选择器用法。分享给大家供大家参考。具体分析如下:

此选择器能够选取所有单选按钮。

语法结构:
复制代码 代码如下:$(":radio")

实例代码:

复制代码 代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="https://www./" />
<title></title>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $(":radio").hide();
  });
});
</script>
</head>
<body>
<ul>
  <li>
    密码框:<input type="password" name="mima" />
    单选按钮:<input type="radio" value="danxuan" />男
  </li>
</ul>
<button>点击查看效果</button>
</body>
</html>

希望本文所述对大家的jQuery程序设计有所帮助。

免责声明:转载请注明出处:http://shjed.com/news/416409.html

扫一扫高效沟通

多一份参考总有益处

免费领取网站策划SEO优化策划方案

请填写下方表单,我们会尽快与您联系
感谢您的咨询,我们会尽快给您回复!