input jquery 操作

本文章主要为了总结开发常用的input等常见html的jquery操作,不是为了展示自己多么菜,只为了积累知识,勿喷!!!不断更新中

$(function () {
            $("input[name=T]").eq(0).attr("checked", "checked"); //默认第一个选中
            $("input[name=T]").each(function () {

                $(this).click(function () {
                    $("input[name=T]").removeAttr("checked"); //不被选中的清除checked属性
                   $(this).attr("checked", "checked"); 
                }); 
               
       });

获得 选中的val

 $(“input[name=T][checked]").val();
Radio
原文地址:https://www.cnblogs.com/DDSkay/p/4108598.html