`

jQuery Raion,Select,CheckBox 选择器函数用法

阅读更多

  Radio

jQuery("input[type=checkbox][name='fbCqscsf.cqzdycqk']").not("[value=1]").attr("checked","");
var item = $('input[@name=items][@checked]').val();
$("input[@type=radio]").attr("checked",'2'); 
$('input[@name=items]').get(1).checked = true; 
the_value = jQuery('#radio_form input:radio:checked').val(); 
$("input[@name='rdio']:checked").val();
//删除select 中除第一个之外的其他option项 
$("#genera :not(option:first)").remove(); 
  
Select

 

jQuery("#wgpz option[value='$!wgpz']").attr("selected",true) ;
$('#select_id')[0].selectedIndex = 1; 
var item = $("select[@name=items] option[@selected]").text(); 
$("#sel").attr("value",'-sel3');
//设置value=-sel3的项目为当前选中项 
the_value = jQuery('#radio_form input:radio:checked').val();

  not函数 

the_value = jQuery('#radio_form input:radio:checked').val(); 
selectionCondition.not($(this)).attr("checked",""); 

 IE浏览器版本检测 

 

 

 

var isVesion = jQuery.browser.msie && (jQuery.browser.version == "6.0") && !jQuery.support.style; 
删除table除第一行外的所有行记录。 
jQuery("#ywmcjlList tr:not(:first)").remove(); 
$("someTableSelector").find("tr:gt(0)").remove();  

   jQuery判断元素是否隐藏

$("#integration").is(":hidden") 
//jQuery Let Div Timing hidden 
var timer = setTimeout("$('#alertmsg').css('display','none')",3000); 
clearTimeout(timer); 
var dialogTop = Dialogs.focusedWindow.dialog[0].style.top; 
var dialogLeft = Dialogs.focusedWindow.dialog[0].style.left; 
var top = e.clientY - parseInt(dialogTop); 
var left = e.clientX - parseInt(dialogLeft); 
jQuery("#demo").css("top", top + "px").css("left", left + "px").fadeIn("fast"); 

   找到每个段落的后面紧邻的同辈元素

//过滤Radios组被选中的radio 
var pramotion = $( "input[type=radio][name='" +name+ "_" +id+ "']" ); 
var checked = pramotion.filter( "input:checked" ); 
checked.next( "label" ).show(); 
pramotion.not( "input:checked" ).next( "label" ).hide(); 
pramotion.not( "input:checked" ).show(); analogyRadio.next( "img" ).hide(); 
  所有兄弟元素集合
counteract.siblings().next( "img" ).hide(); 
//获取其他促销(平台,店铺)同抵价券型的Radio框 
var filterRadio = counteractVolumeRadio.filter($( "input[name!='" +fashion+ "'[value='"+sequence+ "']" )); 
var genera = $( "#genera" ); 
var jsonCategory = $!shopcategory; 
jQuery.each(jsonCategory, function (index,sole){ 
genera.append("<option value=" +sole.typecode+ ">" + sole.typename+ "</option>" ); 
}) 
  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics