在进行其他操作后,恢复select默认选中

html代码:

<select id="shai" style="width:150px;margin:5px 50px 5px 0;" >
<option value="0" selected="selected">筛选</option>
<option value="10101">10101</option>
<option value="10102">10102</option>
<option value="20201">20201</option>
</select>

js代码:

$("#shai").val('0');

$("#shai").attr("value",'0');

jQuery 设置select默认选中问题的更多相关文章

  1. 解决设置select默认选中不生效的方法

    $scope.storageTypeList = ['Glusterfs','NFS','Ceph']; 不生效的方法: <select class="form-control&quo ...

  2. jquery 设置select 默认值

    $('#@(Perfix)OrgType').children("option").each(function () { var temp_value = $(this).val( ...

  3. jQuery设置 select、radio、checkbox 默认选中的值

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. [转]jquery设置select选中,赋值等操作

    一.基础取值问题 例如<select class="selector"></select> 1.设置value为pxx的项选中 $(".selec ...

  5. jQuery 根据value设置radio默认选中

    jQuery 根据value设置radio默认选中:HTML: <input type="radio" name="type" value="1 ...

  6. 如何用原生js或jquery设置select的值

    1.原生js设置select值的方法 (1)有时可能需要隐藏select,但是还得需要更改select所传递的值.(select的默认选中之为第一个,即下标为0的选项值) var gd2=docume ...

  7. 用jQuery的attr()设置option默认选中无效的解决 attr设置属性失效

    表单下拉选项使用selected设置,发现第一次默认选中成功,在页面不刷新的情况下,再次下拉,selected属性设置了,默认选中不生效 在手机端有些浏览器用jQuery的attr()方法设置sele ...

  8. struts2设置<s:select>默认选中项的方法

    struts2的select标签中,常用的有以下几个属性:(1)struts2中的select 标签中,必须设置的属性只有一个,即是list.(2)select标签的list中必须有值,不然会报错.如 ...

  9. jquery设置select选中的文本

    <select id="prov">  <option value="1">北京市</option>  <option ...

随机推荐

  1. IOS touch event animation 转动的风车

    最近开始学习IOS的开发,师兄给我提出一个需求:实现一个可拖动的转盘.师兄提示我说利用touch event和UIView animation.经过一两天的折腾边学边做,算是实现了基本功能.这里写写加 ...

  2. Machine Learning/Introducing Logistic Function

    Machine Learning/Introducing Logistic Function 打算写点关于Machine Learning的东西, 正好也在cnBlogs上新开了这个博客, 也就更新在 ...

  3. iOS状态变更

    iOS应用状态变更 应用启动周期 当应用启动时,它从未运行状态到活跃或后台状态,简单地过渡未激活状态.作为启动周期的一部分,系统为应用创建一个过程和主进程并在主进程上调用应用的主函数.来自你的Xcod ...

  4. Centos 64位 Install certificate on apache 即走https协议

    Centos 64位 Install certificate on apache 即走https协议 一: 先要apache 请求ssl证书的csr 一下是步骤: 重要注意事项 An Importan ...

  5. 免费的Visual Studio的插件

    在做了深入(的)研究之后(通过在google网站搜索),,我编译了15个免费Visual Studio 2005插件表..其中一些插件将提高您(的)代码(的)质量,,另外一些能使您编译(的)更快,,但 ...

  6. hdu 1559 最大子矩阵(DP)

    题目链接:点击链接 #include<stdio.h> #include<string.h> #define max(a,b) a>b?a:b int d[1005][1 ...

  7. android 源码编译 问题 列表

    转自:http://www.cnblogs.com/xilinch/archive/2013/04/02/2996359.html make: *** [out/host/linux-x86/obj/ ...

  8. Windows 8.1 Preview的新功能和新API

    http://msdn.microsoft.com/en-us/library/windows/apps/bg182410 App打包 新的App程序包将使App的提交更简单.资源包可以让你提供附加的 ...

  9. 总结 React 组件的三种写法 及最佳实践 [涨经验]

    React 专注于 view 层,组件化则是 React 的基础,也是其核心理念之一,一个完整的应用将由一个个独立的组件拼装而成. 截至目前 React 已经更新到 v15.4.2,由于 ES6 的普 ...

  10. 驱动05.lcd设备驱动程序

    参考s3c2410fb.c总结出框架 1.代码分析 1.1 入口函数 int __devinit s3c2410fb_init(void) { return platform_driver_regis ...