jQuery 1.3.2°æ±¾Ï嵀 ÉèÖà »ñÈ¡Ò»×éradio±»Ñ¡ÖÐÏîµÄÖµ:var item = $('input[name=items][checked]').val(); »ñÈ¡select±»Ñ¡ÖÐÏîµÄÎı¾ :var item = $("select[name=items] option[selected]").text(); »ò$("select[name=items]").find("option:selected").text(); selectÏÂÀ¿òµÄµÚ¶þ¸öÔªËØΪµ±Ç°Ñ¡ÖÐÖµ:$('#select_id')[0].selectedIndex = 1; selectÏÂÀ¿òvalue = 'val'µÄÔªËØΪµ±Ç°Ñ¡ÖÐÏî:$("select[name=items] option[value='val']").attr("selected","selected"); radioµ¥Ñ¡×éµÄµÚ¶þ¸öÔªËØΪµ±Ç°Ñ¡ÖÐÏî :$('input[@name=items]').get(1).checked = true; »ò$('input[name=items]').attr("checked", '1¡ä); radioµÄvalue = 'val'µÄÔªËØΪµ±Ç°Ñ¡ÖÐÏî:$('input[name=items] [value='val']').attr("checked","checked"); Îı¾¿ò,Îı¾ÇøÓò:$("#txt").attr("value"); ¶àÑ¡¿òcheckbox:$("input[name='checkbox':checked]").each(function(){ var val = $(this).val(); }); µ¥Ñ¡×éradio: $("input[type=radio][checked]").val(); ÏÂÀ¿òselectµÄvalueÖµ: $('select').val(); ÏÂÀ¿òselectÑ¡ÖеÄtext Öµ:$("select").find("option:selected").text(); ¿ØÖÆ±íµ¥ÔªËØ: Îı¾¿ò,Îı¾ÇøÓò:$("#txt").attr("value","); //Çå¿ÕÄÚÈÝ $("#txt").attr("value",'11¡ä); //Ìî³äÄÚÈÝ ¶àÑ¡¿òcheckbox: checkboxµÄvalue='val'µÄÔªËØÇ°´ò¹´:$("input[name=item][value='val']").attr("checked",true); »ò$("input[name=item][value='val']").attr("checked","checked"); if($("input[name=item][value='val']").attr('checked')==true) //ÅжÏÊÇ·ñÒѾ´ò¹´ µ¥Ñ¡×éradio: $("input[type=radio]").attr("checked",'2¡ä);//ÉèÖÃvalue=2µÄÏîĿΪµ±Ç°Ñ¡ÖÐÏî ÏÂÀ¿òselect: $("#sel").attr("value",'-sel3¡ä);//ÉèÖÃvalue=-sel3µÄÏîĿΪµ±Ç°Ñ¡ÖÐÏî $("<option value='1¡ä>1111</option><option value='2¡ä>2222</option>").appendTo("#sel")//Ìí¼ÓÏÂÀ¿òµÄoption $("#sel").empty();//Çå¿ÕÏÂÀ¿ò jQuery»ñÈ¡RadioÑ¡ÔñµÄValueÖµ $("input[name='radio_name'][checked]").val(); //Ñ¡Ôñ±»Ñ¡ÖÐRadioµÄValueÖµ jQuery»ñÈ¡CheckBoxÑ¡ÔñµÄValueÖµ $("input[name='checkbox_name'][checked]"); //Ñ¡Ôñ±»Ñ¡ÖÐCheckBoxÔªËصļ¯ºÏ Èç¹ûÄãÏëµÃµ½
jquery radioÈ¡Öµ,checkboxÈ¡Öµ,selectÈ¡Öµ,radioÑ¡ÖÐ,checkboxÑ¡ÖÐ,selectÑ¡ÖÐ,¼°ÆäÏà¹Ø
»ñÈ¡select±»Ñ¡ÖÐÏîµÄÎı¾
var item = $("select[@name=items] option[@selected]").text();
»ñÈ¡Öµ:
checkboxµÄµÚ¶þ¸öÔªËر»´ò¹´:$("input[name=items]").get(1).checked = true; //´ò¹´
$("input[name=items]").get(1).checked = false; //²»´ò¹´
´úÂë
$("#text_id").focus(function(){//code...}); //ʼþ µ±¶ÔÏótext_id»ñÈ¡½¹µãʱ´¥·¢
$("#text_id").blur(function(){//code...}); //ʼþ µ±¶ÔÏótext_idʧȥ½¹µãʱ´¥·¢
$("#text_id").select(); //ʹÎı¾¿òµÄVlaueÖµ³ÉÑ¡ÖÐ״̬
$("input[name='radio_name'][value='ҪѡÖÐRadioµÄValueÖµ'").
attr("checked",true); //¸ù¾ÝValueÖµÉèÖÃRadioΪѡÖÐ״̬
ValueÖµÄãÐèÒª±éÀúÕâ¸ö¼¯ºÏ
$($("input[name='checkbox_name'][checked]")).
each(function(){arrChk+=this.value + ',';});//±éÀú±»Ñ¡ÖÐCheckBoxÔªËصļ¯ºÏ µÃµ½ValueÖµ
$("#checkbox_id").attr("checked"); //»ñÈ¡Ò»¸öCheckBoxµÄ״̬(ÓÐûÓб»Ñ¡ÖÐ,·µ»Øtrue/false)
$("#checkbox_id").attr("checked",true); //ÉèÖÃÒ»¸öCheckBoxµÄ״̬ΪѡÖÐ(checked=true)
$("#checkbox_id").attr("checked",false); //ÉèÖÃÒ»¸öCheckBoxµÄ״̬Ϊ²»Ñ¡ÖÐ(checked=false)
$("input[name='checkbox_name']").attr
("checked",$("#checkbox_id").attr("checked"));//¸ù¾Ý3,4,5Ìõ,Äã¿ÉÒÔ·ÖÎö·ÖÎöÕâ¾ä´úÂëµÄÒâ˼
$("#text_id").val().split(","); //½«TextµÄValueÖµÒÔ','·Ö¸ô ·µ»ØÒ»¸öÊý×é
Ïêϸ½â¾ö·½°¸
jquery radioÈ¡Öµ,checkboxÈ¡Öµ,selectÈ¡Öµ,radioÑ¡ÖÐ,checkboxÑ¡ÖÐ,selectÑ¡ÖÐ,¼°ÆäÏà¸É
Èȶȣº96 ·¢²¼Ê±¼ä£º2012-11-10 10:48:51.0
Ïà¹Ø½â¾ö·½°¸
- jquery »ñÈ¡jspÒ³ÃæµÄid½â¾ö·½·¨
- Struts2 <select>ÉÏÀ¿ò »ØÏÔÓйØÎÊÌâ
- êPì¶Struts2 select tag †–î},¸ÃÔõô´¦Àí
- <xsl:for-each select= ȡǶÌ×½ÚµãÔòôд,¸ÃÈçºÎ½â¾ö
- jquery£¬¶þάÊý×éÈ¡Öµ¡£½â¾ö°ì·¨
- Çójquery.form.js+jquery.validate.min.js ÓÃajaxÌá½»±íµ¥µÄ´úÂë·¶Àý
- jquery Ìá½»form±íµ¥²»Óòå¼þµÄÄÇÖÖ ÈçºÎÌá½»
- jquery ajax»Ø´«Ã»ÓÐÖµ,¸ÃÔõô´¦Àí
- jquery easyUI datagrid struts2ÓйØÎÊÌâ
- jquery form ÓйØÎÊÌâ
- springmvc jquery ajax Ìá½»¸´ÔÓ¶ÔÏó£¬415Òì³£½â¾ö°ì·¨
- Ó¦ÓÃStruts2 Óë jquery,ajaxÑéÖ¤Óû§×¢²á,²»ÓôÓÊý¾Ý¿â»ñÈ¡Êý¾Ý
- jquery ajax select½â¾ö·½·¨
- php jquery check username ajax¼ì²ìÕʺÅΨһÐÔ
- jquery ajax·µ»ØÖµµÄÓйØÎÊÌâ
- jquery »òjs »ñÈ¡Ö¸¶¨×Ö·û¼äµÄ×Ö·û´®£¬²¢ÂÖ»»¡£»Ø´ð³öÀ´µÄÊÇ´óÉñ¼¶~
- jquery µÄbindÀïÃæÄܲ»ÄÜ»ñµÃ·µ»ØÖµÄØ£¿ ¶ÔСµÜÎÒºÜÄѵÄÓйØÎÊÌâ°¡
- <select>±êÇ©¿ÉƽÌíÎÄ×Ö
- jquery µÄuploadifyÏ´«Í¼Æ¬ÔõôÈóö´íÐÅÏ¢Ìáʾ³ÉÖÐÎÄ
- java+jquery easy ui + json + struts·ÖÒ³Àý×Ó
- Struts2 <s:select/>ÓйØÎÊÌâ
- jquery easyui·ÖҳЧÂÊÓйØÎÊÌâ
- struts checkbox Ò³ÃæÏÔʾ
- jquery ÈçºÎ»ñµÃ¶¯Ì¬Ìí¼ÓºóµÄ×ÓÔªËظöÊý£¿
- jQuery.ajax£¨£©ÇëÇóstruts2Êý¾Ý »Øµ½dataÖµÁËundefined
- ¹ØÓÚStruts2 jQuery PluginµÄ Result,¸ÃÈçºÎ´¦Àí
- jspÒ³Ãæ<select>Ñ¡ÖÐÓйØÎÊÌâ
- Jquery µã»÷°´Å¥ÊµÏÖͼƬ·Ò³,¸ÃÈçºÎ½â¾ö
- checkbox Action´«ÖµÓйØÎÊÌâ
- jquery ¹ØÓÚ¼àÌýcheckboxµÄÑ¡ÖкͲ»Ñ¡ÖÐʼþ,¸ÃÈçºÎ½â¾ö