jquery获取select、checkbox文本值,设置select选中 radio

radio选中状态对应文字改变颜色 效果: html: 本人申请 代替他人申请css: .radio { width: 18px; height: 18px; border: 2px solid #649723; margin-top: 20px; } .radio-font { font-size: 18px; margin-right: 25px; color:#767676; margin-top 阅读详情

 select

<select id="selectItem" name="selectItem" >

         <option value="item1">computer</option>

         <option value="item2">TV</option>

         <option value="item3">Camera</option>

</select>

获得的是value值:

 $("#selectItem").val()="item1"

获得文本值:

$("#selectItem").find("option:selected").text()="computer"

selected选中:

$("#selectedItem").val("item3")   //item3项选中。

 

 

checkbox

<input type="checkbox" name="province" id="province" value="1"/>北京

获得的是value值:  $(this).attr("value")="1"
获得文本值:$(this).parent().text()="北京"


$("input[name='isrelay']:checked").val(); 


jquery操作select大全详解 每一次操作select的时候,总是要出来翻一下资料,不如自己总结一下,以后就翻这里了。 比如 1、设置value为pxx的项选中 $(".selector").val("pxx"); 2、设置text为pxx的项选中 $(".selector").find("option[text='pxx']").attr("selected",true); 这里有一个中括号的用法,中括号里的等号的 阅读详情

相关推荐

jquery 获得select、radio、checkbox选择的text和value值

jquery 获得select、radio、checkbox选择的text和value值详解文档

jquery的radio选中加背景颜色

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> ul { list-style-type: none; font-size: xx-large; width: 320px; } .highlight { background-color: orange; color: white; } </style> <script src="jquery

zwy15841139493的博客 1372

jQuery分别获取选中的复选框值

NULL 博文链接:https://xiaowei-qi-epro-com-cn.iteye.com/blog/1701940

单选去除按钮,点击选中文字,修改文字颜色

页面单选radio点击选中文字改变其颜色 第一次写博客,请多多关照 二话不说上代码: html: <tr> <td><p class="radio-font">性别</p></td> <td> <input type="radio" class="radio" name="sex" value="" id="se...

qq_44524654的博客 690

vcs中systemverilog和c/c++联合仿真

前言 systemverilog中,可以通过DPI、PLI来与外部其它语言的程序进行交互。PLI又分为三类,TF、ACC和VPI,可以认为是PLI技术的三代演进: 其中VPI(PLI3.0)是TF/ACC的一个超集,目前使用的PLI基本上都是VPI。 与PLI技术相独立的另一个技术就是DPI,DPI技术简化了systemverilog与foreign language的交互步骤,对于开发者相对友好,所以使用相对广泛一些。 本文不对DPI中程序调用/数据交互展开讨论(这部分可以参考绿皮书..

kevindas的博客 1万+

Ubuntu docker镜像中下载安装 DPABI(DPARSF)

在Ubuntu服务器的docker镜像中用MATLAB运行DPABI(以及使用DPARSF的功能)。

Pandako's Blog 1723

Jquery如何获取checkbox旁边的文本值

说明 本文主要内容是,如何去获取checkbox旁边的文本值,因为有这个需求去获取文本值做提示,本人对此不是很熟悉,所以花费了不少时间,特此在这里做个记录。 情况说明,上代码 <li><input type="checkbox" id="hx" name="hx" value="9"> 葡萄</li> <li><input type="checkbox" id="hx" name="hx" value="8"> 西瓜</li> &l

weixin_43976226的博客 1013

DOA估计算法从原理到仿真——CBF、Capon、MUSIC算法

从原理出发理解并实现经典的DOA估计算法

m0_55845774的博客 1万+

用jquery获得选择的checkbox的文字值

音乐     美术     信息技术     运动     单选     var hobbies;     $("input[name=likes]").change(function(){         hobbies='';         //console.log($(this)[0].checked);         $("input:checked[nam

Tizzy_Joel的专栏 8346

告别FreeRTOS?手把手带你用NuttX在STM32F4-Discovery上跑起第一个Shell

本文详细介绍了如何在STM32F4-Discovery开发板上从FreeRTOS迁移到NuttX,并运行第一个Shell。NuttX以其完整的POSIX兼容性和模块化架构优势,特别适合复杂网络应用的开发。通过环境搭建、移植配置、调试技巧及POSIX开发实践,帮助开发者高效构建嵌入式系统。

weixin_42526417的博客 302

华为FusionCompute之计算虚拟化

华为FusionCompute之虚拟化

jks212454的博客 2453

Jquery操作select,radio,checkBox,获取选中项的值和文本,根据值和文本设置选中项

$(function () {             //select             $("#Button1").click(function () {                 var v = $("#selProgram").val();                 alert(v);             });             $("#Butto

wangsen2235068的专栏 1万+

【人工智能之深度学习】12. BERT微调实战:医疗文本分类的领域自适应技巧与工业级实现

摘要:医疗文本分类是自然语言处理在医疗健康领域的核心应用,可辅助疾病诊断、病历结构化和医疗质量监控。然而,医疗文本的专业术语密集、实体关系复杂及数据长尾分布等特性,导致通用BERT模型性能受限。本文系统阐述医疗文本分类的领域自适应技术,从理论原理到工业级实现展开全流程讲解。首先分析医疗文本的独特属性及技术挑战;随后详解领域继续预训练、适配器微调、对抗训练等核心技术的数学原理;构建包含数据预处理、模型优化、隐私保护的完整实战架构;通过疾病分类、情感分析、事件检测三大案例验证技术有效性。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 1008

jquery操作select下拉框的多种方法(选中,取值,赋值等)

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

thewindkee的博客 2578

复合材料成型仿真案例大全|覆盖模压 / RTM / 固化 / SMC,实操步骤直接抄

本文整理了一套完整的PAM-COMPOSITE复合材料成型仿真案例合集,涵盖模压、RTM、固化变形、SMC四大核心工艺,包含6个实操案例和1个全流程衔接案例。每个案例都配有详细的操作步骤、核心要点和缺陷排查方法,适用于不同水平的工程师和研究人员。案例内容源自实际项目,可直接复用,帮助用户快速掌握复合材料成型仿真的关键技术,解决褶皱、纤维堆积、气泡残留等常见问题,实现从铺层设计到强度校核的全流程仿真闭环。特别针对热固性/热塑性材料差异、RTM衍生工艺、链式仿真等难点提供了专项解决方案。

源代码杀手的博客 321

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

jQuery获取Select选择的Text和 Value

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

wanglei_smartfish的专栏 936

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

jQuery对select的操作

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

LuckFairyLuckBaby的博客 487

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

深度学习工具包 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")

jquery获取和设置radio,check,select选项

select控件选项 1,获取select选中的value值  $("#selectID").val(); 2,获取select选中的text的值 $("#selectID").find("option:selected").text() 3,设置select的第几项为当前选中项 $("#selectID").attr("value",2);//设置第二项为当前

pan_junbiao的博客 2万+

jq select 获取text_jQuery获取Select option 选择的Text和Value

jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关设置获取一组radio被选中项的值:var item = $('input[name=items][checked]').val();获取select被选中项的文本:var item = $("select[@name=items] option[@selected...

weixin_30536861的博客 442

jquery radio取值,checkbox取值,select取值

jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关 获取一组radio被选中项的值 var item = $(input[@name=items][@checked]).val(); 获取select被选中项的文本 var item = $("select[@name=items] option[@select

fanglm的专栏 644

jquery实用应用之jquery操作radio、checkbox、select

本文收集一些jquery的实用技巧,非常实用的哦,其中对radio、checkbox、select选中与取值的方法。 获取一组radio被选中项的值var item = $('input[@name=items][@checked]').val();获取select被选中项的文本var item = $("select[@name=items] option[@selected]")....

weixin_34130269的博客 79

jquery可以勾选的下拉框_jquery操作select下拉框的多种方法(选中,取值,赋值等)

jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关获 取一组radio被选中项的值var item = $('input[@name=items][@checked]').val();获 取select被选中项的文本var item = $("select[@name=items] option[@selected...

weixin_39738380的博客 427

判断radio是否选中php,Jquery实际应用,判断radio,selelct,checkbox是否选中及选中的值...

jquery取radio单选按钮的值$("input[name='items']:checked").val();另:判断radio是否选中并取得选中的值如下所示:function checkradio(){var item = $(":radio:checked");var len=item.length;if(len>0){alert("yes--选中的值为:"+$(":radio:ch...

weixin_39671467的博客 263

html5取值的方法,jquery怎么取值?

jquery怎么取值?下面本篇文章给大家介绍一下关于 jquery取值的方法。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。JQuery获取 Select选择的Text和Value:语法解释:1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项 时触发2. var checkText=$("...

weixin_39534395的博客 228
下一篇: jquery写入文本值到textarea
IamstudyingJava
博客等级 码龄18年 4粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值