jquery操作select下拉框的多种方法(选中,取值,赋值等).doc_第1页
jquery操作select下拉框的多种方法(选中,取值,赋值等).doc_第2页
jquery操作select下拉框的多种方法(选中,取值,赋值等).doc_第3页
jquery操作select下拉框的多种方法(选中,取值,赋值等).doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

QuerySelectTextValue:1. $(#select_id).change(function()/code.); /Select2. var checkText=$(#select_id).find(option:selected).text(); /SelectText3. var checkValue=$(#select_id).val(); /SelectValue4. var checkIndex=$(#select_id ).get(0).selectedIndex; /Select5. var maxIndex=$(#select_id option:last).attr(index); /SelectjQuerySelect TextValue:1. $(#select_id ).get(0).selectedIndex=1; /Select12. $(#select_id ).val(4); / SelectValue43. $(#select_id optiontext=jQuery).attr(selected, true); /SelectTextjQueryjQuery/SelectOption1. $(#select_id).append(Text); /SelectOption()2. $(#select_id).prepend(); /SelectOption()3. $(#select_id option:last).remove(); /SelectOption()4. $(#select_id optionindex=0).remove(); /Select0Option()5. $(#select_id optionvalue=3).remove(); /SelectValue=3Option6. $(#select_id optiontext=4).remove(); /SelectText=4Optionjquery radiocheckboxselectradiocheckboxselect radiovar item = $(inputname=itemschecked).val(); selectvar item = $(selectname=items optionselected).text();select$(#select_id)0.selectedIndex = 1;radio$(inputname=items).get(1).checked = true;$(#txt).attr(value) checkbox$(#checkbox_id).attr(value)radio $(inputtype=radiochecked).val();select $(#sel).val();$(#txt).attr(value,);/$(#txt).attr(value,11);/checkbox $(#chk1).attr(checked,);/$(#chk2).attr(checked,true);/if($(#chk1).attr(checked)=undefined) / radio $(inputtype=radio).attr(checked,2);/value=2 select $(#sel).attr(value,-sel3);/value=-sel3$(11112222).appendTo(#sel)/option$(#sel).empty()/-/optionoptionfunction changeShipMethod(shipping)var len = $(selectname=ISHIPTYPE option).lengthif(shipping.value != CA)$(selectname=ISHIPTYPE option).each(function()if($(this).val() = 111)$(this).remove(););else$(UPS Ground).appendTo($(selectname=ISHIPTYPE);/xx$(#testSelect option:selected).text();$(#testSelect).find(option:selected).text();$(#testSelect).val();/ 1,:var cc1 = $(.formc selectname=country optionselected).text(); /()var cc2 = $(.formc selectname=country).val(); /var cc3 = $(.formc selectname=country).attr(id); /ID$(#select).empty();/ /$(#select).html();$(1111).appendTo(#select)/option:1. selectname=country optionselected name country select selected option 2,:$(inputtype=radiochecked).val(); / ()$(inputtype=radiovalue=2).attr(checked,checked); /value=2.()3,:$(inputtype=checkboxchecked).val(); /$(inputtype=checkboxchecked).each(function() /,alert($(this).val(););$(#chk1).attr(checked,);/$(#chk2).attr(checked,true);/ if($(#chk1).attr(checked)=undefined) /jquery. .$(document).ready(function()$(#selectTest).change(function()/alert(Hello);/alert($(#selectTest).attr(name);/$(a).attr(href,xx.html);/window.location.href=xx.html;/alert($(#selectTest).val();alert($(#selectTest optionselected).text();$(#selectTest).attr(value, 2);););aaass112233445566jquery radiocheckboxselectradiocheckboxselectradio var item = $(inputname=itemschecked).val();select var item = $(selectname=items optionselected).text();select $(#select_id)0.selectedIndex = 1;radio $(inputname=items).get(1).checked = true; $(#txt).attr(value) checkbox$(#checkbox_id).attr(value)radio $(inputtype=radiochecked).val();select $(#sel).val(); $(#txt).attr(value,);/$(#txt).attr(value,11);/ checkbox $(#chk1).attr(checked,);/$(#chk2).attr(checked,true);/ if($(#chk1).attr(checked)=undefined) /radio $(inputtype=radio).attr(checked,2);/value=2 select $(#sel).attr(value,-sel3);/value=-sel3$(optionvalue=1& gt;11112222/option& gt;).appendTo(#sel)/option$(#sel).empty()/ radiovar item = $(inputname=itemschecked).val();selectvar item = $(selectname=items optionselected).text();select $(#select_id)0.selectedIndex = 1;radio$(inputname=items).get(1).checked = true;$(#txt).attr(value) checkbox$(#checkbox_id).attr(value)radio $(inputtype=radiochecked).val();select $(#sel).val(); $(#txt).attr(value,);/$(#txt).attr(value,11);/ checkbox $(#chk1).attr(checked,);/$(#chk2).attr(checked,true);/ if($(

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论