jquery操作下拉框(select)的一些说明

jquery实现下拉框多选(支持IE7) jquery 实现下拉框多选方法 ,引入 easyui框架 ,支持IE7版本,360 立即下载

 

   公司网站目前的访问用户中使用IE6.0的站50%以上,所以必需兼容IE6.0,使用jquery在IE6.0中设置下拉框时会有以下一些问题

//==========测试代码===============


    下拉框测试
   
   


   


   
  •        
  •        
  •        
  •        
  •    
       
  •      
  •    
        
       
       

  • //==========End 测试代码===================

    测试说明:

     A:静态select项目

      静态select项目(可以通过服务器端脚本填充),可以直接使用$("#下拉框id").val(选中的value)进行设置.

      设置后使用$("#下拉框id").val();可以正确获取其值.

     

     B:有一项静态的

       包含动态创建立的option时,使用$("#selectId").val()

       动态创建的(包含一项静态的option如: 

  • ),可以通过
  •    1.setTimeout("$(/"#下拉框id/").val("+value+")",1)设置.

       但是使用setTimeout后,使用$("#下拉框id").val();取值时则不正确,当然通常情况你的代码上下文保留有value值,

       没必要通过.val()去取,setTimeout缺点是异步执行的,setTimeout执行时的上下文通常不是当前函数域.

     

      2.使用try{$("#下拉框id").val();}catch(e){}来屏蔽错误,

      这个在firefox中跟IE6.0中多可以正常运行,但是IE6.0取值会出问题.

    C:全部动态创建

      这种情况下使用try在IE6.0中也无发设置.

     

     另外IE6.0对动态创建的下拉项目,不能自动调整select宽度,需要手动调整.

     

     

    基于Python的闲鱼商品价格评估模型:爬虫+价格预测全实现 本文介绍了一个完整的全球气候数据抓取与分析流程,采用轻量化的技术栈(requests+pandas+matplotlib+folium),实现以下核心功能: 全球城市定向抓取:支持自定义城市列表,自动获取经纬度并抓取多源气候数据 双数据源互补:结合OpenWeatherMap API(实时数据)和Climate-Data.org(历史数据) 全维度覆盖:采集气温、降水、湿度等核心指标,并进行自动化清洗转换 丰富可视化:生成热力图、趋势图和统计图表,支持地理定位展示 灵活扩展:模块化设计便于新增城市或扩展数据 阅读详情

    相关推荐

    芯片设计-信号完整性 SI 解析:Unit Interval 与比特周期的关系及其在高速信号中的应用

    本文深入解析了芯片设计中信号完整性(SI)的核心概念Unit Interval(UI)与比特周期的关系及其在高速信号中的应用。通过实际案例和计算公式,详细阐述了UI在不同数据速率下的变化、在眼图分析中的关键作用,以及如何应对高速信号设计中的抖动和码间干扰等挑战。文章还提供了PCB布线和芯片设计中的UI优化技巧,帮助工程师提升高速信号设计的实战能力。

    weixin_28683391的博客 468

    Jquery的悬浮框

    Jquery的悬浮框 参考:https://blog.csdn.net/Mars_guest/article/details/79709022 直接贴上代码了: <!doctype html> <html class="no-js"> <head> <meta ...

    stay hungry ! stay foolish! 896

    【低空经济】低空无人驾驶航空器运行管理系统设计方案

    低空无人驾驶航空器运行管理系统(以下简称“系统”)旨在为低空域内的无人驾驶航空器(UAV)提供高效、安全、智能的运行管理服务。系统通过集成先进的通信、导航、监控、数据处理和人工智能技术,实现对低空域内无人驾驶航空器的实时监控、动态调度、风险评估和应急响应,确保其在复杂空域环境中的安全运行。系统的核心功能包括空域管理、飞行计划审批、实时监控、冲突预警、应急管理和数据分析。空域管理模块负责划分和管理低空域资源,确保不同飞行任务之间的空域隔离和高效利用。

    2502_92579126的博客 1140

    jquery操作下拉框select

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

    奋斗的小鸟 2612

    从外包到转正:一个华为OD亲历者的真实工作体验与避坑指南

    本文分享了一位华为OD员工从外包到转正的真实经历与实用建议。通过详细解析华为OD的日常工作、转正核心指标、机试备考技巧及职场突围策略,为读者提供了一份全面的避坑指南。特别针对机试E卷的高频考点和刷题方法,给出了具体的数据分析和实战经验。

    weixin_33686714的博客 694

    手搓ZLMediaKit实现拉流推流系列3(RK3588上YOLO系列拉流、MPP解码+编码、推流全流程)

     前段时间比较忙,一直没有时间补充后续的内容。今天终于抽出空来,立马进入码字环节:手搓ZLMediaKit实现拉流推流系列在本篇也终于迎来了完结篇,在本篇文章中,你将看到以下一整套完整流程:使用ZLMediaKit拉流---MPP解码---Yolo模型进行推理---MPP编码并推流。

    m0_46303486的博客 2172

    jQuery操作Select

    jQuery是如何控制和操作select的。先看下面的html代码 &lt;select id="test"&gt;&lt;option value="1"&gt;选项一&lt;option&gt;&lt;option value="2"&gt;选项一&lt;option&gt; ...&lt;option v

    weixin_34410662的博客 161

    【硬件开发】振铃

    如果是开关管的振铃,那么桥臂的SW处产生的振铃会窜入驱动电路,造成的结果就是驱动电路和上桥臂下桥臂之间的SW节点都会有振铃现象。如果是驱动电路的振铃,那么MCU的输出引脚还是正常的PWM,但是到了MOS管两侧就变成带有振铃的PWM波形了。开关振铃产生的原因是MOS管上面的寄生电感当开关管打开时为了保持电流不变感应出的电压会对电源和地产生冲击。开关管的驱动线上的寄生电容和寄生电感导致的振铃为驱动电路振铃。开关管上的寄生电容和寄生电感导致的振铃为开关节点振铃。、电感等元件的存在,导致电路中的电压和。

    weixin_62546664的博客 1826

    IE下Select下拉框宽度无法自适应Bug

    问题描述: IE6到IE8,Select下拉框宽度无法自适应宽度,当option中的宽度超多select的宽度时,会被截取,如图: 【注】该问题在IE9+、Chrome、FireFox等浏览器中不存在。 解决思路: 当鼠标移到select元素时将其宽度置为auto; 鼠标移开时恢复为原定宽度。 代码(基于jQuery): $(functio

    itguaicai的专栏 3150

    [QMT和ptrade量化交易小白入门]-125、菜场大妈加上四大现金行业指数风控,最大回撤从22%减少了一半

    群里面有人建议,在菜场大妈策略的基础上,加入申万的行业指数(银行,钢铁,有色,煤炭)测算其宽度,当这四大行业其中有一个高就会清仓(用来控制回撤)。这背后的逻辑是,在存量资金博弈的市场环境中,资金总量相对固定,当银行、钢铁、有色、煤炭等大市值周期行业因基本面改善(如涨价、政策催化)或避险需求而走强时,会吸引大量资金涌入,导致其他板块(尤其是小市值股票)面临流动性虹吸。经过回测,对比上一个版本发现确实是可以降低一半的回撤,最大回撤从22.3%降到了11.4%,而且有很多时间是空仓等待。

    木头大左的博客 239

    jQuery实现下拉菜单[代码+详细讲解+效果图]

    jQuery实现下拉菜单[代码+详细讲解+效果图] 非常的高效。

    心态的博客 1万+

    Power Switch与Tap Cell关系

    tap cell可以选用一般类型的tap cell,无须secondary pg pin,因为此时switch cell的阱电位接到输入power net上了,switch cell可以正常上电,也可以给core内正常供电,tap cell的阱电位接switch cell输出的power,需要注意的是此时switch cell与core内其他cell的阱电位是不同的,所以为了避免drc问题,需要在switch上盖hard blockage或者keepout margin。2)自带阱偏置的switch。

    m0_61544122的博客 2334

    jQuery对select操作 ,ption,attr

    jQuery对select操作 标签: jquery select option 获取 自定义 属性 it 分类: javascript //遍历option和添加、移除option function changeShipMethod(shipping){ var len = $("...

    weixin_30258027的博客 486

    深度学习工具包 DeepLearningToolbox

    深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

    ET2012新版免狗免安装绿色软件

    ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

    jquery复选框组清空选中的值_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;...

    weixin_31993501的博客 529

    Statistics and Machine Learning Toolbox

    Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

    JQuery实现下拉框Select的获取值与文本、动态绑定数据、事件等操作

    1、下拉框的应用 在网站中下拉框select是经常使用的控件,下面将介绍JQuery实现下拉框select的获取值与文本、动态绑定选项、事件等操作。 1.1 获取选中项的值 var value = $("#selectUser").val(); 1.2 获取选中项的文本 var text = $("#selectUser").find("option:selected").text(); 1.3 获取选中项的索引 var index = $("#selectUser").get(0).s

    pan_junbiao的博客 1万+

    IDEA的使用指南

    IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

    jQuery下拉框

    来源:https://www.cnblogs.com/songhaipeng/archive/2012/11/25/2787214.html 本文转载而来 jQuery对下拉框Select操作总结 转自网络,留做备用 jQuery获取Select元素,并选择的Text和Value:1. $("#select_id").change(function(){//cod...

    anhu8321的博客 6955

    jquery 将下拉框重置_select下拉框之默认选项清空

    最近和小伙伴发现,select默认选项一般是提示信息,怎么才能让当我们点击下拉框时,可选的选项中没有默认的提示信息呢?思路:1.当点击下拉框时,让默认提示信息,即下拉框第一个选项移除。2.当没有选中下拉框的信息时,让默认提示信息添加到下拉框的第一个选项上。标准select下拉框请选择javajavaScriptvuebootStrapspringMvc$(function () {$("#skil...

    weixin_36080584的博客 5027

    jQuery操作select下拉框的方法

    1、jquery获取当前选中select的text值 var checkText=$("#slc1").find("option:selected").text(); 2、jquery获取当前选中select的value值 var checkValue=$("#slc1").val(); 3、jquery获取当前选中select的索引值 var index=$("#slc1 ")

    whaxrl的专栏 984

    jquery 将下拉框重置_jquery操作select(增加,删除,清空)

    jQuery获取Select选择的Text和Value:引用https://www.cnblogs.com/Luouy/p/5806833.html$("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发var checkText=$("#select_id").find("option:selected").t...

    weixin_39616798的博客 3097

    基于JQuery的Select下拉框下拉框联动(级联)

    这段时间在指导学生完成实训项目,由一个用到了JQuery进行下拉框(select)联动(添加删除option)的操作,本来在上课中都是讲过的,但时间一长都忘光了,下面把这段简单的JS贴出来,给入门者一个DEMO吧,以后有学生不会写的时候他能到这找到参考。 代码要点: 1、使用JQuery给select标签添加option元素时,直接使用: Js代码   $("筛选符").a

    yang_ai的博客 1万+

    jquery 将下拉框重置_select下拉框使用完毕后,重置按钮使其清空

    需求描述:select下拉框后边有两个按钮,一个查询,一个重置,点击重置,select会清空之前选择的那个查询条件解决思路:卧槽,这不so easy 么,用那个jQ封装的trigger函数搞定啊,对select赋个null的值,我真是个人才,哈哈哈哈哈哈哈嗝(仿佛听到了一群人在说MDZZ~~~),好了,上代码代码:重置js代码:function resetBut(){$("#select1").v...

    weixin_39716703的博客 2002

    select下拉框之JS/JQuery详细操作

    select下拉框之JS/JQuery详细操作

    ugfdfgg的博客 664

    jQuery下拉框元素操作

    对select下拉中元素的操作:增、删、清空 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.2.0/jquery.js" type="text/javascript" charset="utf-8">&l

    qq_36521848的博客 2万+

    JQuery操作下拉框 select

    要实现这种效果: html代码 1<script src="js/jquery-1.7.2.min.js"></script> 2 <table> 3 <tr> 4 <td> 5 <!--multiple设定下拉框可以多选,...

    dianhuireng8314的博客 206
    上一篇: 地址重写中使用httpModule映射.htm的问题
    下一篇: SubSonic中RecordBase.Load(IDataReader dataReader)与LoadAndCloseReader(IDataReader dataReader)的使用区别
    WDFrog
    博客等级 码龄21年 7粉丝 132原创
    评论
    成就一亿技术人!
    拼手气红包6.0元
    还能输入1000个字符
     
     条评论被折叠 查看
    添加红包

    请填写红包祝福语或标题

    个

    红包个数最小为10个

    元

    红包金额最低5元

    当前余额3.43元 前往充值 >
    需支付:10.00元
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付元
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值