zoukankan      html  css  js  c++  java
  • JQuery 基础:11.RadioButton操作

    1.取得选中值

    $("input[name=gender]:checked").val()

    2.设置选中值

    $("input[name=gender]").val(["女"]);

    3.checkbox全选、不选、反选

        //全选

                $("#all").click(function () {

                    $(":checkbox").attr("checked", true);

                });

        //全不选

                $("#notxuan").click(function () {

                    $("#d1 :checkbox").attr("checked", false);

                });

        //反选

                $("#fanxuan").click(function () {

                    $("#d1 :checkbox").each(function () {

                       $(this).attr("checked",!$(this).attr("checked"))

                    });

                });

  • 相关阅读:
    8.5
    8.12
    8.11
    8.14
    8.15
    8.18
    8.16
    8.20
    Android新版NDK环境配置(免Cygwin)
    在Windows7上搭建Cocos2d-x win32开发环境
  • 原文地址:https://www.cnblogs.com/xyangs/p/2515447.html
Copyright © 2011-2022 走看看