<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.focusin {
background-color: green;
font-weight: bold;
}
</style>
<script src="js/jquery-1.12.1.js"></script>
<script>
$(function() {
//获得焦点触发
$("input[name='name']").on("focus", function() {
$(this).addClass("focusin");
});
//失去焦点触发
$("input[name='name']").on("blur", function() {
$(this).removeClass("focusin");
});
//失去焦点并且内容发生变化时触发
$("input[name='name']").on("change", function() {
$("#show").text($(this).val());
});
//表单验证
$("form").on("submit", function() {
var name=$("input[name='name']").val();
var sex = $("select[name='sex']").val();
if ((name == "") || (sex == "请选择性别")) {
alert("检查表单");
return false;
} else {
return true;
}
});
})
</script>
</head>
<body>
<div id="show">显示信息</div>
<form action="#">
name:
<input name="name" type="text">
<br /> sex:
<select name="sex">
<option selected="selected">
请选择性别
</option>
<option>男</option>
<option>女</option>
</select>
<input type="submit" value="提交">
</form>
</body>
</html>相关推荐
《Ventoy 制作系统安装 U 盘的具体步骤》
然后您可以在电脑的磁盘管理中对 U 盘进行快速格式化,选择 FAT32 或 NTFS 文件系统。至此,Ventoy 系统安装 U 盘就制作完成了。您可以在需要安装系统的电脑上,从 U 盘启动,然后选择相应的系统镜像进行安装。安装完成后,将您需要的操作系统镜像文件(如 Windows、Linux 等的 ISO 格式镜像)复制到 U 盘的根目录。在安装程序中,选择您插入的 U 盘设备,确保选择正确,以免误操作。2. 确认选择的 U 盘盘符正确,防止误操作导致其他磁盘数据丢失。点击“安装”按钮,等待安装完成。
js系列教程8-事件全解
printf("===========事件绑定==========="); //时间可以在h5代码中直接添加也可以在js代码中添加 var input1=document.getElementById("input1"); input1.onclick = function(event){ //事件也是元素对象的方法属性,可以直接设置和调用input1.onclick(),删除input1.on
Ubuntu20.04安装Eigen3.3.7、模板类Sophus和Ceres
Sophus的使用必须依赖3.3以上的Eigen版本。如果版本太低,Sophus库将无法安装使用。
input 元素 change 事件失效,失去焦点的时候才执行?什么原因导致?如何正确使用?
按想来说当input输入框里面的内容发生变化后,就会触发change事件啊,change事件不是在输入的时候触发吗?当按键抬起的时候触发的事件,在该事件触发之前一定触发了onkeydown事件–相当于一个按键,两个事件(onkeydown不常用)当input失去焦点时触发,注意:这个事件触发的前提是已经获取了焦点再失去焦点的时候才会触发该事件,用于判断标签为空。的地方,刚刚按下的时候还没有写入内容,只有弹起的时候写入才完成,所以控制台总是比输入的内容要慢一拍(少一个)。那仅仅是大家的想当然,其实在。
【原创】Ubuntu20.04 安装 Isaac Gym 仿真器
Ubuntu20.04 安装 Isaac Gym
uniapp - 超详细 H5 网页引入百度地图教程,附地图示例 / 获取当前设备定位的省市区、详细地址、经纬度信息 / 用户当前 IP 属地定位地理位置等等(新手小白快速上手,详细配置及使用全流程)
uniapp百度地图,uniapp百度地图ip属地定位,uniapp百度地图获取省市区详细地址经纬度等,uniapp百度地图当前用户设备定位省份市区详细所在地ip属地等详细教程示例,uniapp网页h5引入百度地图详细教程,uniapp h5网站使用百度地图详细教程,uniappH5端如何接入使用百度地图api,uniapp H5网页端百度地图获取地理位置信息,uniapp h5页面引入百度地图,uniapp h5平台百度地图获取城市信息,uniapp百度地图获取经纬度,uniapp 百度地图拿省市区用什么
【创造者】 表单属性-
表单用于收集用户的输入, 给服务器提交信息。
电子元器件-接口电路篇:RS-232、RS485/422、I2C、SPI、USB、网口
以上规定说明了RS-232C 标准对逻辑电平的定义。对于数据(信息码):逻辑“1”的传输的电平为-3V~-15V,逻辑“0”传输的电平为+3V~+15V;对于控制信号;接通状态(ON)即信号有效的电平为+3V~+15V,断开状态(OFF)即信号无效的电平为-3V~-15V,也就是当传输电平的绝对值大于3V 时,电路可以有效地检查出来;
Flask+LayUI开发手记(九):关于layui-form表单中的选择域
但选项域就是不支持这种,哪怕你去查DOM,发现已经设上了,实际显示也是无效的,必须用form.val()才有效。输入域会直接触发change事件,而选项域并不会触发change事件,而是会触发form.on()表单事件,所以,要想监测手动选项变成,就必须要写一个form.on()程序来处理,所以,对于选项域(select、checkbox、radio),可能要针对change和form.on写出同样的程序,当然,你也可以在change中写处理,在form.on中触发change事件,这样也是可以的。
【异常】解决 Claude Code 及第三方插件提示 “API Error: 404“ 的配置修复指南
在使用 Claude 相关的 CLI 工具(如)或 IDE 插件进行开发辅助时,配置错误的模型参数是导致连接失败的常见原因。本文将针对这一典型报错进行复盘与解决。
①电子产品拆解分析-暖手宝
电子产品拆解分析-暖手宝 ①按键三档调温暖手; ②长按进入氛围呼吸灯; ③安卓接口充电以及支持USB输出;
layui框架 select下拉选择器 onchange方法失效解决方案
选项1</option><option value="2">选项2
Manus创始人深度复盘:AI Agent产品的技术架构与战略转型
成本对比:同样任务处理,中国区单位成本是亚太区的2.3倍。付费转化率:中国区1.2% vs 全球平均4.7%微信/支付宝等超级App的适配代码占比达17%Zstandard:压缩比38%,耗时12ms。每季度需要投入3名高级工程师专职维护兼容性。国际版API平均延迟:180-220ms。中国版特殊部署延迟:480-720ms。信息保持准确率:93%(7天跨度测试)自研算法:压缩比39%,耗时5ms。存储效率:相比纯文本节省68%空间。:本地化部署导致的延迟与费用差异。LZ4:压缩比42%,耗时8ms。
jQuery 表单事件
@{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>ChapterTwoFormEvent</title&g
深度学习工具包 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');```[](https://bitdeli.com/free "Bitdeli Badge")
TMS_WebGMaps_1.9.8.0_Full_Source
TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder
jQuery事件之表单事件
1. jQuery表单事件之blur与focus事件 在之前我们学过了表单处理事件focusin事件与focusout事件,同样用于处理表单焦点的事件还有blur与focus事件。 它们之间的本质区别:是否支持冒泡处理 举个简单的例子 其中input元素可以触发focus()事件 div是input的父元素,当它包含的元素input触发了focus事件时,它就产生了foc
win10 跳过U8环境检测的IE WebControls.rar
win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。
jQuery表单事件示例
jQuery带有五个常见的表单事件来处理表单元素的动作。 1. focus() 当元素处于焦点时触发。 $("input,select,textarea").focus(function () { //do something }); 2. blur() 当某个元素失去焦点时触发。 $("input,select,textarea").blur(function ()...
jre9下载 jdk9
(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】
jquery的表单事件
表单事件是web开发中常用的事件,以jquery为例,梳理一下jquery的表单事件。 1、blur事件 为元素,失去焦点的时候触发的。 2、focus事件 为元素,获取焦点的时候触发的。 3、change事件 ,和的值都是可以发生改变的,可以通过change事件监听元素改变的动作, input元素:监听input中value值的变化,当value改变时,失去焦点后触发c
jQuery表单选择器、事件
获取特定的表单元素内容: $(":input[type=password").val(); 鼠标点击事件:click(); 鼠标滑入事件:mouseover(); 鼠标滑出事件:mouseout(); 鼠标按下事件:mousedown(); 鼠标抬起事件:mouseup(); 获取焦点事件:focus(); 失去焦点事件:blur(); ...
jQuery获取表单值及几个表单事件
获取表单值 .val()方法,主要用于input,select和textarea标签元素 它可以获取匹配元素中的第一个元素的值,如果加上参数,可以设置所有元素的值 <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <
JQuery 课时16:JQuery表单事件
JQuery 课时15:JQuery事件对象1、focus()-获得焦点事件2、blur()-失去焦点事件3、change()-一个元素的值改变就会触发,仅限于input、select、textarea4、select(),当选择元素中的文本中触发,仅限于input type=text、select、textarea5、submit(),当用户提交表单时触发,只能用于form表单上 1、focus()-获得焦点事件 <!DOCTYPE html> <html lang="en"> &
jQuery 表单事件与遍历示例
zhangsan@example.com</span><span class="user-name">赵六</span> - <span class="user-email">zhaoliu@example.com
jquery 监听表单事件的两种方式
思路: 一个直接调用其方法,另一个用on <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0.
jQuery表单事件
jQuery在处理表单上也做了事件处理 目录 focus() blur() change() select() submit() focus() 描述:获取焦点出发事件 :适用于所有元素。 $(function(){ $('#target').focus(function(){ console.log(123); }) }) blur()...
jQuery---表单事件
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-...
jQuery表单事件submit事件
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <script src="../jquery-1.10.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#aa")
jQuery总结 - 键盘事件/表单事件
事件 描述 .blur() 为 “blur” 事件绑定一个处理函数,或者触发元素上的 “blur” 事件(注:此事件不支持冒泡)。 .change() 为JavaScript 的 “change” 事件绑定一个处理函数,或者触发元素上的 “change” 事件。 .focus() 为 JavaScript 的 “focus” 事件绑定一个处理函数,或者触发元素上的 “foc...
2678



被折叠的 条评论
为什么被折叠?



