记录jquery使用方法
1、select控件使用
设置值为test的option为选中状态
$("#id").val("test").attr("selected","selected");//或者
$("#id[value='test']").attr("selected","selected");2、实现倒计时功能
定义显示倒计时的div
<div id="timetest"></div>
var id = setInterval( "refreshTime()" , 1000 ); // 每格1秒刷新一次
var i=5;
function refreshTime(){
if(i==0){
$("#timetest").html("完成");
clearInterval(id);
}else{
var dateObj = new Date();
$("#timetest").html(i--); // 刷新div里面的内容
}
}