• jquery资料收集


     $("input[name='radio_name'][checked]").val(); //选择被选中Radio的Value值

     $("#text_id").focus(function(){//code...}); //事件 当对象text_id获取焦点时触发
     $("#text_id").blur(function(){//code...}); //事件 当对象text_id失去焦点时触发
     $("#text_id").select(); //使文本框的Vlaue值成选中状态
    $("input[name='radio_name'][value='要选中Radio的Value值'").
    attr(
    "checked",true); //根据Value值设置Radio为选中状态

    $("input[name='checkbox_name'][checked]"); //选择被选中CheckBox元素的集合 如果你想得到

    Value值你需要遍历这个集合
    $($("input[name='checkbox_name'][checked]")).
    each(function(){arrChk+=this.value + ',';});//遍历被选中CheckBox元素的集合 得到Value值
    $("#checkbox_id").attr("checked"); //获取一个CheckBox的状态(有没有被选中,返回true/false)
    $("#checkbox_id").attr("checked",true); //设置一个CheckBox的状态为选中(checked=true)
    $("#checkbox_id").attr("checked",false); //设置一个CheckBox的状态为不选中(checked=false)
    $("input[name='checkbox_name']").attr
    ("checked",$("#checkbox_id").attr("checked"));//根据3,4,5条,你可以分析分析这句代码的意思
    $("#text_id").val().split(","); //将Text的Value值以','分隔 返回一个数组
  • 相关阅读:
    BFS(广搜训练题目)
    练习赛1(补题)
    练习赛1(AC题)
    codeup 1743: 算法3-4:表达式求值
    数学相关(更新ing)
    c语言常用函数(更新ing)
    大牛的博客(学习不止,更新不止)
    51nod 1005 大数加法
    js1-----预览js内容
    css10---转载---定位,浮动
  • 原文地址:https://www.cnblogs.com/nosnowwolf/p/456783.html
Copyright © 2020-2023  润新知