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

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.http://www.cnblogs.com/wangyuelang0526/p/4909472.html

时间: 2024-11-10 01:26:42

jQuery Raion, Select, CheckBox selector function的相关文章

jQuery遍历和操作表单元素Select,checkbox,radio

 jQuery获取Select选择的Text和Value: 语法解释:  代码如下 复制代码     1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发     2. var checkText=$("#select_id").find("option:selected").text(); //获取Select选择的Text     3. var c

JS,Jquery获取select,dropdownlist,checkbox下拉列表框的值

 本篇文章主要是对JS,Jquery获取select,dropdownlist,checkbox下拉列表框的值(示例代码)进行了介绍,需要的朋友可以过来参考下,希望对大家有所帮助 jQuery获取Select选择的Text和Value:  语法解释:  1. $("#select_id").change(function(){//code...});   //为Select添加事件,当选择其中一项时触发  2. var checkText=$("#select_id"

JS,Jquery获取select,dropdownlist,checkbox下拉列表框的值(示例代码)_javascript技巧

jQuery获取Select选择的Text和Value: 语法解释: 1. $("#select_id").change(function(){//code...});   //为Select添加事件,当选择其中一项时触发 2. var checkText=$("#select_id").find("option:selected").text();  //获取Select选择的Text 3. var checkValue=$("#se

JQuery操作textarea,input,select,checkbox方法_jquery

今天学习怎样用JQuery编写一些小的代码,小小的试了一下编写一个textarea,代码如下: <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <style type="text/css" media="screen"> *{ marg

Jquery获取radio,checkbox,select的值

  radio <input type="radio" name="rd" id="rd1" checked="checked" value="rd1"/> <input type="radio" name="rd" id="rd2" value="rd2"/> <input type="

jquery radio,checkbox,select取值与选中代码

jquery radio,checkbox,select取值与选中代码 获取一组radio被选中项的值 var item = $('input[@name=items][@checked]').val(); 获取select被选中项的文本 var item = $("select[@name=items] option[@selected]").text(); select下拉框的第二个元素为当前选中值 $('#select_id')[0].selectedIndex = 1; rad

jQuery对select操作小结(遍历option,操作option)

本篇文章是关于jQuery对select的操作进行了总结介绍,需要的朋友可以参考下   //遍历option和添加.移除optionfunction changeShipMethod(shipping){  var len = $("select[@name=ISHIPTYPE] option").length  if(shipping.value != "CA"){   $("select[@name=ISHIPTYPE] option").e

Jquery 改变radio/checkbox选中状态,获取选中的值

 这篇文章主要介绍了Jquery 改变radio/checkbox选中状态,获取选中的值(示例代码) 需要的朋友可以过来参考下,希望对大家有所帮助 //如果之前有选中的,则把选中radio取消掉 $("#tj_cat .pro_category").each(function() {  if ($(this).attr('checked')){                         $(this).attr('checked' ,false);                

jQuery获取Radio,CheckBox选择的Value值

 这篇文章主要是对jQuery获取Radio,CheckBox选择的Value值进行了详细的介绍,需要的朋友可以过来参考下,希望对大家有所帮助 $("input[name='radio_name'][checked]").val(); //选择被选中Radio的Value值 $("#text_id").focus(function(){//code...}); //事件 当对象text_id获取焦点时触发 $("#text_id").blur(f