百度出来的代码都是这样的:1 $('#test option[text="b"]').attr("selected",true);或1 $('#test').find('option[text="b"]').attr("selected",true);然而,在我的代码中却不起作用,不知原因为何!终于...
分类:
Web程序 时间:
2015-02-13 14:34:37
阅读次数:
332
1、用jQuery或js写HTML元素属性的时候要尽量写得精确。如:$('.village-form input, textarea').attr('disabled', true);这样写,对于disabled属性的范围就固定了,如果不写.xxxclass的话,则可能因为disabled属性而传不...
分类:
其他好文 时间:
2015-02-11 16:08:49
阅读次数:
115
/*ie8 button链接支持*/ $(‘button‘).each(function(){ var url = $(this).parent().attr(‘href‘); if(url!=‘‘){ $(this).attr(‘onclick‘,"jump(‘"+url+"‘)"); } });...
分类:
其他好文 时间:
2015-02-10 18:57:58
阅读次数:
184
$(function(){ var _srcList = [], i = 0; //获取所有图片路径,存为数组 $('.bg').each(function(){ _srcList.push($(this).attr('src')); }) fun...
分类:
其他好文 时间:
2015-02-09 18:14:08
阅读次数:
233
eg:$('.setIsEnableClosed').click(function(){var id=$(id).attr("name");var isChecked=$(this).prop("checked");$.ajax({url:"../../ashx/Widget.ashx",data:...
分类:
Web程序 时间:
2015-02-09 15:52:52
阅读次数:
177
/*页面右侧栏动作*/ $(".side ul li").hover(function(){ var selected = $(this).attr("id"); if(selected != null && selected == "tel...
分类:
Web程序 时间:
2015-02-08 18:07:50
阅读次数:
255
checkbox全选,反选,取消选择 jquery。//checkbox全部选择$(":checkbox[name='osfipin']").each(function(){ $(this).attr("checked",true);});//checkbox取消全选$(":checkbox[nam...
分类:
Web程序 时间:
2015-02-05 13:05:52
阅读次数:
180
1.insert into smar_attr select id+1,concat('st',id+1),'#1112fasd1' from smar_attr order by id DESC limit 1例如 需求: ID 其他字段 id20150207001 X...
分类:
数据库 时间:
2015-02-05 10:53:04
阅读次数:
128
大家都理解这是什么,正常的写法例如以下: if (status == true) { $("#minDelistStr").val(totalAmount);// 去掉首部的“,”并写入到货品id串中 $("#minDelistStr").attr("readonly",true); }但是在网.....
分类:
Web程序 时间:
2015-02-04 21:46:04
阅读次数:
226
functiongetStyle(obj,attr){if(obj.currentStyle){returnobj.currentStyle[attr];}else{returngetComputedStyle(obj,false)[attr];}}functionstartMove(obj,json,fn){clearInterval(obj.timer);obj.timer=setInterval(function(){varbStop=true;//这一次运动就结束了——所有..
分类:
其他好文 时间:
2015-02-04 18:59:59
阅读次数:
131