1. jQuery取得select选中的值

    本来以为jQuery("#select1").val();是取得选中的值,

    那么jQuery("#select1").text();就是取得的文本。

    这是不正确的,正确做法是:

    jQuery("#select1  option:selected").text();

  2. jQuery取得input单选radio选中的值

    var gender = $("input[name='gender']:[checked]").val();    兼容几乎所有浏览器

    var gender = $("input[name='gender'][checked]").val();这个个别浏览器不支持呢

    2017.3.24 今天是周五啦啦啦啦啦啦啦啦

jQuery如何获得select选中的值?input单选radio选中的值的更多相关文章

  1. jquery设置、判断、获取input单选标签选中状态

    1.设置某项单选input为选中状态: $("input[type='radio']").eq(1).attr('checked',true); ②也可设其属性checked为'c ...

  2. input[type=radio]选中的样式变化

    input[type=radio]:hover{ border: 2px solid #D0D0D0; } input[type=radio]:focus{ border: 2px solid #1B ...

  3. jquery中获取radio选中值的正确写法

    错误写法: //只在IE下有作用,其他浏览器均获取的为第一个单选框的值 $('input[type=radio]').val(); 正确写法为: //兼容所有浏览器写法 $('input[type=r ...

  4. 设置checkbox选中,设置radio选中,根据值设置checkbox选中,checkbox勾选

    设置checkbox选中,设置radio选中,根据值设置checkbox选中,checkbox勾选 >>>>>>>>>>>>&g ...

  5. Jquery常用radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关设置

    获取一组radio被选中项的值:var item = $('input[name=items][checked]').val(); 获取select被选中项的文本:var item = $(" ...

  6. jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中

    jQuery获取Select选择的Text和Value: 语法解释: 1. $("#select_id").change(function(){//code...}); //为Se ...

  7. jquery操作select下拉框的多种方法(选中,取值,赋值等)

    Query获取Select选择的Text和Value: 语法解释: 1. $("#select_id").change(function(){//code...}); //为Sel ...

  8. Jquery 获取 radio选中值,select选中值

    随着Jquery的作用越来越大,使用的朋友也越来越多.在Web中,由于CheckBox.Radiobutton .DropDownList等控件使用的频率比较高,就关系到这些控件在Jquery中的操作 ...

  9. Jquery怎么获取select选中项 自定义属性的值

    Jquery如何获取select选中项 自定义属性的值?HTML code <select id="ddl" onchange="ddl_change(this)& ...

随机推荐

  1. BZOJ 3238: [Ahoi2013]差异 后缀自动机 树形dp

    http://www.lydsy.com/JudgeOnline/problem.php?id=3238 就算是全局变量,也不要忘记,初始化(吐血). 长得一副lca样,没想到是个树形dp(小丫头还有 ...

  2. WampServer -- “You don't have permission to access /phpmyadmin/ on this server.”

    当你安装完成wamp后,打开localhost或ip时发现已经可以运行了 但想使用phpmyadmin时,发现提示如下内容: You don't have permission to access / ...

  3. hdu 3340 Rain in ACStar 线段树区间等差数列更新

    Rain in ACStar Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/problem/show/1385 ...

  4. 2015 UESTC 搜索专题F题 Eight Puzzle 爆搜

    Eight Puzzle Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/contest/show/61 ...

  5. hust 1590 - 方块游戏 数学

    1590 - 方块游戏 Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/problem/show/1590 D ...

  6. HTML导出Excel数据类型转换样式参考

    mso-number-format:"0" NO Decimals mso-number-format:"0/.000" 3 Decimals mso-numb ...

  7. MemoryModule -- load a DLL completely from memory

    https://github.com/fancycode/MemoryModule MemoryModule is a library that can be used to load a DLL c ...

  8. FreeRTOS API

    Task Creation xTaskCreate vTaskDelete Task Control vTaskDelay vTaskDelayUntil uxTaskPriorityGet vTas ...

  9. Fixed DC-DC Regulator Output Uses A Digitally Controlled Potentiometer

    http://electronicdesign.com/print/passives/fixed-dc-dc-regulator-output-uses-digitally-controlled-po ...

  10. js+Ajax,Get和Post在使用上的区别

    get和post方法最大的不同在于: 1.get方法传值参数在url里面,而post参数放send里面 2.post方法必须加上 xmlHttp.setRequestHeader("Cont ...