jQuery Raion, Select, CheckBox selector function

简介:

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()
$("#genera :not(option:first)").remove(); // Delete select except the first one than the other  option Item  
复制代码

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');

not function

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

IE browser version detection

var isVesion = jQuery.browser.msie && (jQuery.browser.version == "6.0") && !jQuery.support.style;
 Delete the first line of the outer table in addition to all rows of the records  .
jQuery("#ywmcjlList tr:not(:first)").remove();
$("someTableSelector").find("tr:gt(0)").remove();

jQuery to determine whether the hidden element

复制代码
$("#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");
复制代码

To find the back of each paragraph next to sibling

// Filtering Radios group selected 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();
// To obtain additional promotions  ( Platform, shops  ) With flowers-Radio box
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>" );
})
复制代码

If the attribute name contains "-" so, you must use quotation marks:

复制代码
jQuery  Code  :
$(this).is(':checked')//jQuery CSS  Style settings  $("p").css({ color: "#ff0011", background: "blue" });$("p").css({ "margin-left": "10px", "background-color": "blue" });
$(this).css("border","2px dashed #000000");
$("input[type=submit]").css({height:"30px",width:"40px"});
$("p").css({"background-color":"yellow","font-size":"200%"});
$(this).css({
        width: function(index, value) {
          return parseFloat(value) * 1.2;
        },
        height: function(index, value) {
          return parseFloat(value) * 1.2;
        }
});
$('div:eq(0)').css({
    'font-size' : '2em',
    'color' : '#cc00ff'
});

$("p").css({
  "color":"white",
  "background-color":"#98bf21",
  "font-family":"Arial",
  "font-size":"20px",
  "padding":"5px"
});

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()
复制代码

 


作者: 望月狼
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.http://www.cnblogs.com/wangyuelang0526/p/4909472.html
相关文章
|
7月前
|
数据库
element多选框select下拉框数据回显的问题value.push is not a function
element多选框select下拉框数据回显的问题value.push is not a function
671 1
|
JavaScript
jQuery数据结构渲染(4):复选框checkbox赋值
jQuery数据结构渲染(4):复选框checkbox赋值
70 1
|
JavaScript
jQuery 复选框 checkbox 取值和赋值
jQuery 复选框 checkbox 取值和赋值
143 0
|
JavaScript
jQuery取消checkbox选中状态
jQuery取消checkbox选中状态
59 0
|
JavaScript Java
jQuery点击checkbox选择标签到指定的位置
jQuery点击checkbox选择标签到指定的位置
60 0
|
JavaScript 前端开发
一行jQuery代码搞定checkbox 全选和全不选
一行jQuery代码搞定checkbox 全选和全不选
|
JavaScript
jquery 使用attr方法对checkBox进行全选和反选操作
一次点击按钮进行全选的时候,checkbox全部选中;再次点击的时候,checkbox取消选中。 第二次,第三次,之后再点击,没有效果,代码也执行。checkbox的checked属性也改变,但是checkbox就是没有 被选中。问题解决办法是把红色部分中的attr方法修改
140 0
|
JavaScript 前端开发
Jquery 实现click 选中checkbox 多选(或一键选中全部或取消全部)实例代码
Jquery 实现click 选中checkbox 多选(或一键选中全部或取消全部)实例代码
284 0