`
mefly
  • 浏览: 148285 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

jquery 常用代码

阅读更多
得到当前节点的第一个子节点
$("div").children().eq(0) 

  

多选框循环

$("[name='ids']:checkbox").each(function(){
			if ($(this).attr("checked")==true){
				i++;
				str+=$(this).val()+"_";
			}	
		});

 

 

下拉列表所选的选项中的属性

alert($("#batch_bz option:selected").attr("je"));

 

 

 

css 设置

$("p").css("color","red");
 


改变兄弟td 内的元素的属性

 

$(this).parents("tr").find("td").eq(2).find("select").get(0).options.length = 0;
 

 

 

 

 

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics