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()
作者:望月狼
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.